aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Resizing JPanel and its inner components when JFrame is maximised Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Resizing JPanel and its inner components when JFrame is maximised" Watch "Resizing JPanel and its inner components when JFrame is maximised" New topic
Author

Resizing JPanel and its inner components when JFrame is maximised

Anusha Bhatnagar
Greenhorn

Joined: May 24, 2011
Posts: 9
Hi,

I'm using a JPanel with absolute Layout Manager.Then I add it to my Frame.I want to resize the components and the panel when the frame is maximised.I have tried many ways but nothing seems to work like trying using BorderLayout for the frame when adding the panel etc

Here the code skeleton
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2203
    
    7
I'm using a JPanel with absolute Layout Manager.


That is your problem. Don't use a null layout.

Simply create a panel and add it to the frame using:



By default it will go to the CENTER of the BorderLayout and will automatically size whenever the frame is resized.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Resizing JPanel and its inner components when JFrame is maximised