• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GridLayout Stretch my JTextFields...

 
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: 3509
16
Android Java
  • 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