The moose likes Swing / AWT / SWT and the fly likes JSplitpane  / JDesktopPane problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply 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: 19216

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
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: 19216

You're welcome.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JSplitpane / JDesktopPane problem
 
Similar Threads
opening a frame on click on JMenuItem
Change Table and Tree color when selected (vice versa)
JInternalframe will not maximise on setMaximum(true)
JSplitPane events
Trying to understand how layouts resize