Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JSplitpane / JDesktopPane problem

 
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
 
Sheriff
Posts: 21999
107
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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
Posts: 21999
107
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic