Does anybody know what the trick is to add a JToolBar to a JDesktopPane? I am creating a MDI swing app and using JInternalFrames in a Layered Pane. I can get tool bars and menus in the JInternalFrames but only menus in the JDesktopPane.
Here is a snippit of code:
JDeskTopPane = new JDesktopPane(); //a specialized layered pane
setContentPane(desktop); // Set contnetPane to the desktop
// Create my tool bar....
..
..
desktop.add(jToolBar1, BorderLayout.CENTER);
When I try this nothing shows up. To test the code I did not left JFrames ContentPame to its default and then replaced desktop.add(jToolBar1, BorderLayout.CENTER); with
getContentPane.add(jToolBar1, BorderLayout.CENTER); and it worked.
Am I missing something?
Thanks in advance
Jeff Sulman
Here is a snippit of code:
JDeskTopPane = new JDesktopPane(); //a specialized layered pane
setContentPane(desktop); // Set contnetPane to the desktop
// Create my tool bar....
..
..
desktop.add(jToolBar1, BorderLayout.CENTER);
When I try this nothing shows up. To test the code I did not left JFrames ContentPame to its default and then replaced desktop.add(jToolBar1, BorderLayout.CENTER); with
getContentPane.add(jToolBar1, BorderLayout.CENTER); and it worked.
Am I missing something?
Thanks in advance
Jeff Sulman