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
  • 52,963
  • 14
  • 96
  • 130
Brian
  • 1,851
  • 16
  • 56
  • 100

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
  • 200,320
  • 28
  • 229
  • 974