• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do you make the textfield and button the same size? FlowLayout

 
Ixus See
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Guys,

I'm using Flow Layout for my search panel for some reason.. The Jtextfield and button is of different height, I have try setting the size and etc. but it doesn't work.
 
Roel De Nijs
Sheriff
Posts: 10232
129
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe that's just because JTextField and JButton are rendered with their default size. But I'll slide this over to the Swing forum for some expert advice.
 
Paul Clapham
Sheriff
Posts: 21152
32
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your primary goal is that two adjacent components should be exactly the same size, then GridLayout would be a better choice.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ixus See wrote:I have try setting the size and etc. but it doesn't work.


Did you set the preferredSize? also, what look & feel are you using?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic