I am using WindowBuilder to create a GUI application. So, I placed a JTable, right clicked, and click surround with JScrollPane. I then dragged the JScrollPane to go into a JTabbedPane so that I could use it in a tab. However, the JTable is locked at the top, the resize anchors at the corners aren't working, and there is no height to the JTable. The JScrollPane is correctly sized, but the JTable is stuck at the top with a height of 0. This issue also occurs when the JScrollPane is outside of the JTabbedPane.
Relevant portion of the code:
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 850, 650);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
tabbedPane.setBounds(10, 11, 814, 578);
contentPane.add(tabbedPane);
JScrollPane scrollPane = new JScrollPane();
tabbedPane.addTab("New tab", null, scrollPane, null);
table = new JTable();
scrollPane.setViewportView(table);
setVisible(true);
I solved the problem. I had to add this line:
table.setFillsViewportHeight(true);
to make it fill the JScrollPane's viewport.