Reputation: 2748
I have this simple JFrame
the classname is MainFrame
here is the screenshot
I want to do some MDI
thing.
for now, I only know this
private void mhsaddshowActionPerformed(java.awt.event.ActionEvent evt) {
addMhs AM = new addMhs();
AM.setVisible(true);
//desktopPane.add(AM);
}
and with my script above now i have two separated window.
so how can i make the second window (addMhs();
) as the child and MainFrame as the parent ?
I'm new with this, maybe you can share a tutorial link about my problem. Thanks in advance
Upvotes: 2
Views: 70
Reputation: 2900
in order to make MDI app with java you have to use DesktopPane and add JInternalFrame inside your DesktopPane.
Upvotes: 2
Reputation: 15333
Frames will have a separate window.
You should use Panel instead.
You can show a panel inside JFrame
. Read how to use panel.
Upvotes: 1