Re: Newbie: Prevent stretching of widgets when using LayoutManagers?



On 2006-02-28, francisrammeloo@xxxxxxxxxxx penned:
Hi all,

The problem with my Java components is that they stretch along when
I resize the window. They become way too big.

I've been able to prevent this using:

thePanel.setMinimumSize( thePanel.getPreferredSize() );
thePanel.setMaximumSize( thePanel.getPreferredSize() );

But once I started using JTabbedPane inside another JTabbedPane this
method does not seem to work anymore.

Can anyone help? Any help or hint will be greatly appreciated!


I can't give you the answer, but I think that the answer will depend
on which LayoutManager each of your panels is using. Different
LayoutManagers respect different size constraints.

What layout managers are you using?

You can probably address the sizing issues by using a different layout
manager.

--
monique

Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
.