I have been developing an user interface with Java Swing, and I have met a problem in JPanel resizing.
This is my problem: I would like to let a JPanel be resizable by the user, when the user points its mouse over the JPanel border line (as described in the following figure). Now, if I move my mouse over that line, nothing happens. I would like that I could change its size with my mouse.

Here’s my code portion:
JTabbedPane _tabbedPane = new JTabbedPane();
JPanel gridAndCommandPaneValidation = new JPanel();
gridAndCommandPaneValidation.setLayout(new BorderLayout());
ValidationTableModel vtm = new ValidationTableModel(new LinkedList<DatabaseAnalysisValues>());
tableValidation = new JTable(vtm);
JScrollPane scrollpaneVal = new JScrollPane(tableValidation);
tableValidation.setAutoscrolls(true);
gridAndCommandPaneValidation.add(scrollpaneVal, BorderLayout.WEST);
gridAndCommandPaneValidation.add(getKBestValidationCommandsPanel(), BorderLayout.EAST);
_tabbedPane.add("Validation", gridAndCommandPaneValidation);
Is there anyone that can help me?
Many thanks!
Take a look at
JSplitPaneand the corresponding Java Tutorial. This component can do exactly what you want and it behaves very well. Try the first example in the tutorial, you’ll see.