package demo;

public class Minimal {

static class MyApp extends wx.App {

public MyApp() {
super();
}

public boolean onInit() {

MyFrame frame = new MyFrame("Minimal jwx! App");
frame.show();

return true;
}
}

static class MyFrame extends wx.Frame {

public MyFrame(String title) {

super(null, 0, title);

setIcon(new wx.Icon("src/demo/mondrian.png"));

wx.MenuBar mb = new wx.MenuBar();

wx.Menu fileMenu = new wx.Menu();
wx.Menu helpMenu = new wx.Menu();

fileMenu.append(wx.ID.EXIT, "E&xit\tAlt-X", "Quit this program");
helpMenu.append(wx.ID.ABOUT, "&About...\tF1", "Show about dialog");

mb.append(fileMenu, "&File");
mb.append(helpMenu, "&Help");

setMenuBar(mb);

createStatusBar(2);

connect(wx.ID.EXIT, wx.Core.EVT_MENU, "onExit");
connect(wx.ID.ABOUT, wx.Core.EVT_MENU, "onAbout");
}

private void onAbout(wx.Event evt) {
wx.MessageBox.show("This is the About Dialog of the Minimal sample.\n"+
"Welcome to jwx! " + wx.Version.VERSION_STRING);
}

private void onExit(wx.Event evt) {
close();
}
}

public static void main(String [] args) {
MyApp app = new MyApp();
app.run(args);
}
}