Answers for "observable pattern java"

2

java observable

setChanged();
notifyObservers(object_that_u_want_to_send_to_Observer);
Posted by: Guest on March-03-2020
1

observer pattern java

class Signal extends Observable {

  void setData(byte[] lbData){
    setChanged(); // Positionne son indicateur de changement
    notifyObservers(); // (1) notification
  }
}
Posted by: Guest on October-13-2020
1

observer pattern java

class JPanelSignal extends JPanel implements Observer {

  void init(Signal lSigAObserver) {
    lSigAObserver.addObserver(this); // (2) ajout d'observateur
  }

  void update(Observable observable, Object objectConcerne) {
    repaint();  // (3) traitement de l'observation
  }
}
Posted by: Guest on October-13-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language