I could be wrong, but I think it does that automatically.
It seems like you're probably using a GridLayout or GridBagLayout
that is streaching the button back out to fit its grid. If this is the
case try:
public class FooButton extends JButton {
public Dimension getMaximumSize() {
return getPreferredSize();
}
};
-KC
"Samivelu, Srinivasan" <[EMAIL PROTECTED]>@eos.dk on
11/15/2001 04:56:49 AM
Sent by: [EMAIL PROTECTED]
To: "'advanced-swing @eos.dk'" <[EMAIL PROTECTED]>
cc:
Subject: Dynamically setting the size of the button
Dear All
I want set the size of the button dynamically based on its label.
Can anybody throw light on it.
Thanks in advance
Srinivasan
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing