import javax.swing.SwingUtilities;
/**
* The missing SwingApplication class in Java Swing Framework.
*
* @author raistlic
*/
public abstract class SwingApplication {
public abstract void runLater() throws Exception;
public abstract void handleException(Throwable t);
public final void execute() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
runLater();
}
catch(Throwable t) {
handleException(t);
}
}
});
}
}