JPanel size  
Author Message
bali_n





PostPosted: 9/6/2003 4:27:00 AM Top

java-programmer, JPanel size I need to get the size of a JPanel so that I can dynamically set the
size of the scrollpane that'll contain it. How do I get the dimensions
of a JPanel before it is actually displayed ??

-snr
 
Ike





PostPosted: 9/6/2003 10:11:00 AM Top

java-programmer >> JPanel size The JScrollPane will size to the .setPrefferedSize of the component that the
JScrollPane resides in - the JPanel residing in your JScrollPane will thus
size to the JScrollPane automatically. What you need to set, size-wise, is
the PrefferedSize of the Component (which may be getContentPane()) that
holds the JScrollPane. //Ike

"Sudarshan Raghavan" <email***@***.com> wrote in message
news:email***@***.com...
> I need to get the size of a JPanel so that I can dynamically set the
> size of the scrollpane that'll contain it. How do I get the dimensions
> of a JPanel before it is actually displayed ??
>
> -snr