set minimum and maximum size of JButton
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   dennis_deChampeaux
Posted On:   Wednesday, December 17, 2008 12:10 AM

I set the minimum and maximum size of two buttons with code like:

			
JButton addOneB = new JButton("Add");
addOneB.setMinimumSize(buttonSize);
addOneB.setMaximumSize(buttonSize2);


buttonSize = buttonSize2 = {200,30}.

Still the two buttons show up with different sizes.
Their sizes depend on their labels, while the min and the max assignments are simply ignored.



What is going on here?

Re: set minimum and maximum size of JButton

Posted By:   dennis_deChampeaux  
Posted On:   Wednesday, December 17, 2008 01:08 AM

I should have used setPreferredSize


The books I used are wanting on the topic of sizes. A web article showed me the way ...

Phew ....

About | Sitemap | Contact