so basically I need to have 2 windows and in the first one I have (an initially empty) JList
and in the 2nd one I have a JTable
. Once I double click on an item from the JTable
it needs to add a corresponding item to the JList
(I am not yet sure what this will be, perhaps the String value of the first cell in the row in which I double-clicked). Furthermore, if I ever have any items in my JList
then their corresponding values in the table must be highlighted in a different colour, so the row in which I double-clicked should be set to red. Additionally, if I remove an item from the JList
at some point, it should change the colour of the corresponding row in the table back to black.
I am just wondering if somebody could give me advice on the best approach to design an application like this and in particular (if nobody can suggest anything else) would it be more effiecient to use observers, rather than some getter methods? I have not yet tried working with observers but if they are a better choice in this case then I'm happy to try and learn.
Thanks