I placed a JTable inside a JPanel associated with a GridBadLayout manager. Even though I set the size of the JTable with setSize(int,int) the JTable ends up tiny.
How do I control its size? There is plenty of room on the JPanel.
posted 12 years ago
One way with GridBagLayout is to set both weightx and weighty constraints to non–zero and set the fill constraint to GridBagConstraints.BOTH. This will allow the JTable to expand to fill the space available to it in the JPanel.