Reputation: 2051
I have a JTable
that gets data added to it from another JTable
.
Now I want to switch between JTable
s 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 JTable
s (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:
Upvotes: 1
Views: 261
Reputation: 205785
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.
Upvotes: 1