wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JSplitpane  / JDesktopPane problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JSplitpane  / JDesktopPane problem" Watch "JSplitpane  / JDesktopPane problem" New topic
Author

JSplitpane / JDesktopPane problem

Marcel van der Ven
Greenhorn

Joined: Mar 20, 2010
Posts: 14
Hello,

I have a question about splitpanes and jdesktoppanes.
I want to build a MDI application, this application has 1 JFrame with a JDesktopPane into it, now I want to add a big menubar on the right side of the screen (the same as the My Computer window in XP, only the menubar is on the right side). In that menubar the user can navigate to different screens, these screens will be shown on the left side of the menubar. The menubar must always be visible and cannot be closed.

I have programmed this and this works fine, but now I want to make the menubar horizontal sizeable. I do this by placing a JSplitPane into the desktop pane, but now I cannot put the content pane in the left component because the split pane is part of the content pane, and you cannot add the parent to the child. When I leave the left component of the splitpane blank, the content pane area where my internal frames will be shown is gone. The splitpane has consumed the whole screen.

What's the best approach to solve this? If I put a JPanel in the left component for example, is it then still possible to make a MDI application with internal frames (these will then be shown on top of the panel) or do I need the jdesktoppane for my internal frames?

Marcel
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

Why not make the JDesktopPane the JSplitPane's left component, and put the JSplitPane directly onto the JFrame?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Marcel van der Ven
Greenhorn

Joined: Mar 20, 2010
Posts: 14
Good hint, I reprogrammed the application and it works great.

Thanks Rob.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSplitpane / JDesktopPane problem