• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to make the JButton's height the same with JTextField?  RSS feed

 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to


Of course I can set textfield height to the button's height.But that somehow looks urgly.Oh, I use JGoodies's FormLayout. I think it has nothing with what layout I use. Now what's the problem at last?
Thank you in advance.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this seems to work OK

 
Alan Moore
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out FormLayout's setRowGroups() method.
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.
button.setPreferedSize(textField.getPreferedSize());
That's it!
prefer? What does it mean indeed?
Go to java tutrorial for reference.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!