I have 3 ArrayLists and a JTable.
I would like to be able to add/edit/remove elements from the selected (from one of the 3) ArrayList by selecting the elements in the JTable and for example clicking on a button.
I have this code for using only one ArrayList:
/* ... */
EventList<MyClass> eventList = GlazedLists.eventList(myFirstArrayList);
SortedList<MyClass> sortedList = new SortedList<MyClass>(eventList, null);
filterList = new FilterList<MyClass>(sortedList);
EventTableModel<MyClass> listModel = new EventTableModel<MyClass>(filterList,
myTableFormat);
table.setModel(listModel);
TableComparatorChooser.install(table, sortedList,
AbstractTableComparatorChooser.MULTIPLE_COLUMN_MOUSE);
selectionModel = new EventSelectionModel<MyClass>(filterList);
table.setSelectionModel(selectionModel);
/* ... */
How could I change the source of the EventList or the FilterList to the 2. or the 3. ArrayList so if I edit the EventList it will modify the source ArrayList too?