File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes How to prevent auto resize in BorderLayout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to prevent auto resize in BorderLayout" Watch "How to prevent auto resize in BorderLayout" New topic

How to prevent auto resize in BorderLayout

Jay Mistry

Joined: May 19, 2001
Posts: 16
I have a swing application which has a main screen that will hold many internal frames and a JLabel that acts like a status bar. Currently I am using BorderLayout and have added the status bar lable to the SOUTH border. Now however when ever I try to open any internal frames the internal frame is added to the CENTER border and is streached so that it takes up the whole screen; this is even after I have provided a size for these internal frames. How do I prevent the internal frames from streaching?
I am also suspecting that when I do get around this problem there will be another problem present. I think after I get the windows to show up the size I want, when I minimize them they will be hidden behind the statusbar lable - am I correnct to assume this, and if I am how can I also prevent this from happening?
I would really appreciate any input from anyone out there.
Thank you very much.
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Jay,
I think you might be better off using the JDesktopPane instead to perform the functionality you are proposing. The API for JDesktopPane:

A container used to create a multiple-document interface or a virtual desktop. You create JInternalFrame objects and add them to the JDesktopPane.

It has different layers which you can then use to position your status component so that it won't be covered by other panes or icons.
I agree. Here's the link:
subject: How to prevent auto resize in BorderLayout
It's not a secret anymore!