Hello.
I'm doing about box for my program and I don't know why but I actually
thaught that this is going to be easy.
I deceided to go with JInternalFrame and I can't get thing working. First I
created one instance at begining and deceided just to show her when needed.
I can't do even that. I put her in JDesktopPane inside main JFrame hidden
but when I use AboutForm.show(); nothing happens. So I started looking for
simplest example of JInternalFrame usage and found one:
------action performed (AboutMenuItem)------
JDesktopPane Desktop = new JDesktopPane();
Desktop.setVisible(false); // without this blue rectangle adds to main Form
getContentPane().add(Desktop);
JInternalFrame frame = new JInternalFrame("About Playlist File Copier",
true, true, true, true);
frame.setLocation(10, 10);
frame.setSize(200, 150);
frame.setBackground(Color.white);
Desktop.add(frame);
frame.moveToFront();
---------------------------------------------------
Without second row blue rectangle adds itself to Form so I guess
JDesktopPane works but still no JInternalFrame showing up! Why?? Don't know
if it helps but except JDesktopPane main JForm has JPanel as a cointainer
(with more JPanels inside), box layout and JMenuBar of course.
I work with NetBeans. Thanks for replys.
--
Kova
Kova - 22 Jun 2004 16:45 GMT
solved
I used:
getLayeredPane().add(internalframe, JLayeredPane.DEFAULT_LAYER);
internalframe.setBounds(10,10,200,200);
internalframe.setVisible(true);
--
Kova