1

I have a JTable that gets data added to it from another JTable.

Now I want to switch between JTables according to the day selected in a JComboBox.

For example, if I choose Monday I add programs added to it then I select Tuesday from the JComboBox and a fresh JTable appears. If I go to Monday again the programs should still be there (until the program is closed).

How do I create multiple JTables (the JTable remains the same) for the days and let the info remain there until program closure?

Here is an example to show you what I mean:

enter image description here

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
Brian
  • 1,951
  • 16
  • 56
  • 101

1 Answers1

1

Filtering the rows in an existing table seems easier. See Sorting and Filtering for how to create a RowFilter, instances of which can be added to a JComboBox and applied in the combo's action listener.

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