Thanks. I was suppoed to extend the class, and call setchange before notifyobservers
On Tue, Aug 23, 2016 at 7:58 PM, Steve Hannah <[email protected]> wrote: > notifyObservers() will only notify observers if hasChanged() returns > true. Ie. When a change is detected, you need to call setChanged() first > before calling notifyObservers. > > https://docs.oracle.com/javase/7/docs/api/java/util/Observable.html# > notifyObservers(java.lang.Object) > > Steve > > On Tue, Aug 23, 2016 at 11:53 AM, Akinniranye James < > [email protected]> wrote: > >> The observer does not receive any event >> >> On Tuesday, August 23, 2016 at 7:52:50 PM UTC+1, Akinniranye James wrote: >>> >>> Observer observer = (Observable o, Object arg) -> { >>> System.err.println("Got " + arg); >>> }; >>> observable.addObserver(observer); >>> >>> button.addActionListener(l -> { >>> Display.getInstance().callSerially(() -> { >>> observable.notifyObservers(new Date()); >>> }); >>> }); >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "CodenameOne Discussions" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> Visit this group at https://groups.google.com/grou >> p/codenameone-discussions. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/codenameone-discussions/26fbcc57-1687-4e9f-ac53-6f21db83 >> 84f1%40googlegroups.com >> <https://groups.google.com/d/msgid/codenameone-discussions/26fbcc57-1687-4e9f-ac53-6f21db8384f1%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Steve Hannah > Software Developer > Codename One > http://www.codenameone.com > > -- > You received this message because you are subscribed to a topic in the > Google Groups "CodenameOne Discussions" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/codenameone-discussions/iukq5uq4LFU/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > Visit this group at https://groups.google.com/ > group/codenameone-discussions. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/codenameone-discussions/CAGOYrKUCwEkOQgV-3kcpk-DfVrJN% > 2BzW0_oNxyRE3-kEFhHBF4w%40mail.gmail.com > <https://groups.google.com/d/msgid/codenameone-discussions/CAGOYrKUCwEkOQgV-3kcpk-DfVrJN%2BzW0_oNxyRE3-kEFhHBF4w%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at https://groups.google.com/group/codenameone-discussions. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/CALqiy6CF8XU0FXgjFk1Z6U6T4nT62EOT5FNGvZBmrLGqoDQN8w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
