Answers for "observer pattern java"

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