Normalmente quando voglio notificare alla vista un cambio nello stato del modello eseguo questa funzione:
setChanged();
notifyObservers(argument)
se oltre al cambio voglio anche trasmettere un valore faccio:
setChanged();
notifyObservers(argument,value)
Ciò che non capisco ora è come gestire il secondo parametro passato nella funzione update.
public void update(Observable obs, Object arg) {}
Per fare ad esepio un:
switch(value)
case a: System.out.print(argument);
ecc....