Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GUI and desktoppane

Status
Not open for further replies.

Chrissirhc

Programmer
May 20, 2000
926
GB
Hello again. I created a small GUI with internal frames and everytime I change the parent frame size for example the internal frame pops up to be the same size as it can anyone help with this. I used JDesktopPane as the contentpane of the main JFrame and this solves the problem. BUT is there disadvatanges to me doing this?.

Chris
 
JDesktopPane looks quite interesting. It seems to be about allowing overlapping multiple windows (like you would expect on a windows desktop).
The frames themselves will be JInternalFrames and have a manager (JDesktopPane.getDesktopManager()) to look after iconising, resizing, etc. Wherever an object has a model (like a table or tree) or a manager it is always better to use this as the control.

If this has too much in it, you might take a look at JLayeredPane which JDesktopPane extends. My Home -->
 
I wanted to add a toolbar to the desktoppane so I set its layout to borderlayout now the internal frame keeps on popping up to full size. Even worse I wanted to put tabbed panes in the desktopane below the file menu and tool bar and this won't let me resize the internal frame at all.
Does anyone understand this GUI problem.
 
Borderlayout is a fairly basic layout manager. Sounds like you need to use something else.

I got my colleague to use the JDesktopPane following your post, and it's working quite well....thanks for pointing me to something I hadn't seen before. :) My Home -->
 
What layout would you suggest. Border layout is needed so I can add the toolbar to main frame. Did your colleague use toolbars with his GUI. How did he get around this problem?
 
I got it sorted out. I added desktoppane to the centre of the main frame using a border layout. I think that you can add desktop pane to other things probably as well
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top