I am new to Apache Pivot.
I am tryng to make a simple window with menu bar.
The code I used to load the main frame is:
public class MyApp implements Application {
private Frame frame;
@Override
public void startup(Display display, Map<String, String> strings) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
frame = (Frame)bxmlSerializer.readObject(MyApp.class, "/gui/MainFrame.bxml");
frame.open(display);
}
@Override
public boolean shutdown(boolean b) throws Exception {
if(frame != null) {
frame.close();
}
return false;
}
@Override
public void suspend() throws Exception {
}
@Override
public void resume() throws Exception {
}
public static void main(String[] args) {
DesktopApplicationContext.main(MyApp.class, args);
}
}
The main frame BXML is like:
<root:MainFrame title="MyApp" maximized="true"
xmlns:bxml="http://pivot.apache.org/bxml"
xmlns="org.apache.pivot.wtk"
xmlns:root="com.myproject.client">
<menuBar>
<bxml:include src="wtk/menubar.bxml"/>
</menuBar>
</root:MainFrame>
The MainFrame.java is like:
public class MainFrame extends Frame implements Bindable {
public MainFrame() {
Action.getNamedActions().put("myaction1", new Action() {
@Override
public void perform(Component source) {
......
}
});
}
}
The result of this code is like the picture below:
As you can see there is an Mac window outside and a frame window inside.
My question is that how can I get rid of the system window OR get rid of the frame window so that only one window is shown?
Thank you very much.