This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

GridLayout Stretch my JTextFields...  RSS feed

 
Julio Cesar Marques
Ranch Hand
Posts: 80
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to avoid this behavior?

I have to put each JTextField in a different JPanel? Seems strange to me...

I want to make my screen like this:

LB: TF
LB: TF
LB: TF

Sou i try one GridLayout 3x2 but it stretch TextFields...

What to do?

Thanks!
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For GridLayouts, the components stretches to fill the space. You can put the JTextField onto a JPanel then put this JPanel to the GridLayout.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!