I have an application with a main JFrame that contains a default list model. I want that if I modify something on these records, the second running application is automatically updated.
So far I have a MainController class which implements the listener and overwrites the update method:
public class MainController implements ActionListener, Observer {
public void update(Observable o, Object o1) {}
}
and a simple class that extends Observable
public class Comanda extends Observable{}
My problem is that if I delete one record from the first application, the second list doesn't update. The program is deleting the record from the text file but is not updating the default list model. Same problem with edit or add.
I tried adding "reloadList()" in the update method, but that doesn't work. Ideas?
Observer/Observablereally should have been deprecated in 1.1. I also would use anonymous inner classes rather than having a single class do multiple tasks.) - Tom Hawtin - tackline