java - Extending Swing components to run on EDT -


for java swing components, idea extend , override constructor , calls ensure executed on event dispatch thread?

@override public void setbackground(final color c) {     if(swingutilities.iseventdispatchthread()) {         super.setbackground(c);     } else {         //force run on edt through invokeandwait or invokelater     } } 

also (dumb question); if run new runnable within edt, run call executed (conventional top-down)?

@override public void actionperformed(actionevent e) {     runnable r = new runnable() {         public void run() {             // update buttons         }     }     r.run(); // runs } 


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -