java observable
setChanged();
notifyObservers(object_that_u_want_to_send_to_Observer);
java observable
setChanged();
notifyObservers(object_that_u_want_to_send_to_Observer);
observer pattern java
class Signal extends Observable {
void setData(byte[] lbData){
setChanged(); // Positionne son indicateur de changement
notifyObservers(); // (1) notification
}
}
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
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us