case WindowEvent.WINDOW_OPENED: {
addDisplay(applicationContext.getDisplay());
createTimer();
// Load the application
Application application = null;
try {
Class<?> applicationClass = Class.forName(applicationClassName);
application = (Application)applicationClass.newInstance();
applicationContext.setApplication(application);
} catch(Exception exception) {
Alert.alert(MessageType.ERROR, exception.getMessage(),
applicationContext.getDisplay());
exception.printStackTrace();
}
// Set focus to the display host
DisplayHost displayHost = applicationContext.getDisplayHost();
displayHost.requestFocus();
// Start the application
if (application != null) {
try {
application.startup(applicationContext.getDisplay(),
new ImmutableMap<String, String>(properties));
} catch(Exception exception) {
displayException(exception);
}