Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSplitpane / JDesktopPane problem

 
Marcel van der Ven
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not make the JDesktopPane the JSplitPane's left component, and put the JSplitPane directly onto the JFrame?
 
Marcel van der Ven
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good hint, I reprogrammed the application and it works great.

Thanks Rob.
 
Rob Spoor
Sheriff
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic