Re: Automatic resizing of a Container

masukomi <[email protected]>
Newsgroups gmane.comp.embedded.carlsbad-cubes
Message-ID <[email protected]>
put those panels both within a panel and do border layout or flow  
layout in there...that would probably do it. I don't know that vbox is  
even needed in what you're doing.

what's with the <panel /> tags though?


-Kate Rhodes
Open source consultant & Java developer
http://www.masukomi.org
On Jun 1, 2004, at 4:22 AM, Frederic Gedin wrote:

> Hi
>
>
> Is there a way to automatically rezize a container when one of its
> components has changed its size?
>
> The organization of my various components can be represented in XML  
> (SwiXML
> compliant) by:
>
> <panel id="panel_media" layout="borderlayout"
>   border="EmptyBorder(10, 10, 10, 10)"
>   constraints="BorderLayout.CENTER" >
>   <vbox constraints="BorderLayout.CENTER" >
>     <panel />
>     <panel id="panel_video" maximumsize="180,140" preferredsize="180,14 
> 0" 
>       background="black" />
>     <panel id="control_video" maximumsize="180,35" preferredsize="180,3 
> 5"
>       border="BevelBorder(1)" />
>     <panel />
>   </vbox>
> </panel>
>
> When I change the size of the JPanel with ID "panel_video", I would  
> like to
> have the whole JPanel with ID "panel_media" to be resized  
> automatically.
> The Java code I use is:
>
> ....
> // retrieves JPanel with ID panel_video   
> JPanel videoPanel = getVideoPanel();
> // retrieves JPanel with ID panel_media   
> JPanel mediaControlPanel = getMediaControlPanel();
> ... Other changes inside videoPanel
> videoPanel.setSize(newSize);
> mediaPanel.updateUI();
>
> I tried also by repacking the whole application frame without any  
> success.
>
> Did I miss something?
>
> Regards
>
> Frederic
>
> _______________________________________________
> Forum mailing list
> [email protected]
> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.