2

I have four JTables arranged in a 2x2 square. I want the columns and rows to be connected: when a column on one table is rearranged or resized (by the user or otherwise), I want the same things to happen to the table above or below (in real time); when rows or columns are sorted or highlighted, I want the highlighting to happen in the adjacent table, forming a continuous line of selection. Screenshot

To the right, the numbered columns are the start of new tables (four tables in all)

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
Ethan Reesor
  • 2,090
  • 1
  • 23
  • 40

1 Answers1

2

To synchronize scrolling, the vertical scroll bars of separate scroll panes can share a common BoundedRangeModel. To synchronize selection, separate tables can share a common ListSelectionModel. The table models must be commensurate. There's an example showing two tables in this Q&A.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045