Friday, 6 September 2013

Best way to collapse invisible Java Swing components

Best way to collapse invisible Java Swing components

I have some Java Swing components whose visible property is set to false.
When they are not visible I do not want them to take up any space in the
layout. What is the best way to accomplish this?
I am looking to emulate the behavior of WPF's Visibility.Collapsed.
EDIT: I am using MiGLayout. As kiheru describes in the answer, the problem
I was having is particular to MiGLayout, not Swing layouts in general.

No comments:

Post a Comment