About Swing Buttons which automatically takes size of its text.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   nitin_kale
Posted On:   Tuesday, August 17, 2004 09:01 AM

			

Swing Buttons decide their sizes according to Text/caption provided.

How to set size of all Buttons Equally? or as equal to the biggest text?

Re: About Swing Buttons which automatically takes size of its text.

Posted By:   niklas_gustafsson  
Posted On:   Thursday, October 14, 2004 02:21 AM

Try.
Insets insets = new Insets(0,0,0,0);

int bHeight = 24;

int bWidth = 24;

JButton butt = null;

for (int i = 0; i
{

butt = (JButton)comps[i];

butt.setMargin(insets);

butt.setSize(bWidth,bHeight);

}
About | Sitemap | Contact