public class SimpleApplication extends Application
implements IExceptionListener
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class members
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/** the main/content panel. */
private UIPanel panMain;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Initialization
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* Creates a new instance of SimpleApplication
.
*
* @param pLauncher the launcher
*/
public SimpleApplication(UILauncher pLauncher)
{
super(pLauncher);
setName("Simple application");
init();
}
/**
* Initializes the application.
*/
private void init()
{
ExceptionHandler.addExceptionListener(this);
panMain = new UIPanel();
panMain.setLayout(new UIBorderLayout());
panMain.add(YOUR COMPONENT, UIBorderLayout.CENTER);
setLayout(new UIBorderLayout());
add(panMain);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Interface implementation
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public IContainer getContentPane()
{
return panMain;
}
public IContent showMessage(OP pOpener,
int pIconType,
int pButtonType,
String pMessage,
String pOkAction,
String pCancelAction) throws Throwable
{
System.out.println(pMessage);
return null;
}
public void handleException(Throwable pThrowable)
{
System.out.println(CommonUtil.dump(pThrowable, false));
}
} // SimpleApplication