I've created a Swing component which has several methods.
Now I want all methods of this class be run on Event Dispatch Thread (EDT), while callers are on Worker threads.
The only solution currently in my mind is this:
for each method
public void a(params)
on this class, I should rename it to
private void aOnEDT(params)
and add another method
public void a(params){ SwingUtilities.invokeAndWait(new Runnable(){ public void run() { aOnEDT(params); } }); }
But isn't it nasty?
How can I do this?
I hope someone help me out of this.
Thank you