Brian
Brian

Reputation: 2051

JTable multiple instances

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

Upvotes: 1

Views: 261

Answers (1)

trashgod
trashgod

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

Related Questions