Resize components in a JFrame
1 posts in topic
Flat View  Flat View

Posted By:   enrique_p
Posted On:   Friday, November 8, 2002 12:59 AM

Hi everybody,

I need to know how i can resize the JComponents inside a JFrame. Once the size of the JFrame is made bigger by pushing the maximun button, in the frames upper right corner. The frames size is made bigger, but the components remain at the preffered size givin to them.Is it any simple method one can use.

The components have a prefferedSize() wich matches the prefferedSize() of the JFrame..


Re: Resize components in a JFrame

Posted By:   Christopher_Schultz  
Posted On:   Friday, November 8, 2002 11:08 AM

The best way to do this is to use a LayoutManager and not mess with the preferred sizes of each of your widgets.

If you use a LayoutManager, when the frame is resized, the LayoutManager should take care of resizing and redisplaying the components within the Frame.

Hope that helps,

About | Sitemap | Contact