I'd like to have x JTables on top of each other acting like one JTable. I have created x separate JScollPanes - one for each table and inserted them all into one JPanel (panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
).
I only show the header for the top most table. In order to achieve them scrolling horizontally in unison, I have used here.
I need two more tasks left to achieve the desired result of it looking like one big JTable.
I'd like there to only be one vertical scroll bar? How to achieve this?
I'd like all tables to share the same TableColumnModel as the top most table (which is the only one that shows the header) so if a column is moved via drag drop header, all tables reflect the change...
In case anyone is wondering, I previously tried to add each JTable to a JPanel and then add each JPanel to one JScrollPane. The problem with that solution is that if one of the JTable's has many entries, a vertical scroll bar won't appear to show all the entries....