Re: Handling exceptions in SwingWorker



Efi Merdler wrote:
How do you call a method on the EDT, do you use
SwingUtilities.InvokeLater(new Runner(...
exception(e));


SwingUtilities.invokeLater( new Runnable() {
public void run() {
exception(e);
}
});

You can also implement a method in non-EDT-safe way, too:

public void exception( final Throwable e ) {
if ( SwingUtilities.isEventDispatchThread() ) {
// manipulate the GUI
} else {
SwingUtilities.invokeLater( new Runnable() {
public void run() {
exception(e);
}
});
}
}


Bye
Michael
.