I'm attempting to add a JTable with NetBeans GUI builder. The table is inside a panel which already has a scroll bar. Netbeans automatically creates all JTables inside of a JScrollPane.
However, I want the table to scroll as part of a larger page. I do not need two scroll bars.
My problem is: if I get rid of the scroll pane, I lose the header.
Is there a way to have a table with a header inside the Netbeans GUI builder?
JTableHeader
is (automatically) visible in the case thatJTable
is insideJScrollPane
you have to get
JTableHeader
fromJTable
and place this Object programatically by usingLayoutManager
to the container, I'm strongly recommend to useBorderLayout
orGridBagLayout
for this container