The problem isn't with the JTabbedPane
or the JScrollPane
or the JTable
, the problem is with your GradesInfo
JPanel
.
JPanel
uses a FlowLayout
by default, which honours the preferredSize
of the components added to it.
Instead, set the layout of the GradesInfo
panel to BorderLayout
To change the way that the tabs are laid out, see JTabbedPane#setTabLayoutPolicy
You'll probably want yo use JTabbedPane.SCROLL_TAB_LAYOUT