I have an application with a basic JFrame that contains the default list model. I want that if I change something in these entries, the second running application is automatically updated.
So far, I have a MainController class that implements a listener and overwrites the update method:
public class MainController implements ActionListener, Observer { public void update(Observable o, Object o1) {} }
and a simple class extending Observable
public class Comanda extends Observable{}
My problem is that if I delete one entry from the first application, the second list will not be updated. The program deletes the entry from the text file, but does not update the default list model. Same issue with editing or adding.
I tried adding "reloadList ()" in the update method, but this does not work. Ideas?
source share