java - Why GUI not updating in Observer pattern? -


i have observable class notifies observer when string changes. in observer's update method updated string can printed console. gui not updated accordingly. why?

public void update(observable o, object arg) {      string s=swimmingcompetition.init().getscoredata().getresults();     system.out.println(s); //this works     jtextarea1.settext(s); //this not  } 

i bet neglecting invoke addobserver() on observer, or neglecting invoke both setchanged() and notifyobservers() in observable. complete examples shown here.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -