This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes GridLayout Stretch my JTextFields... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "GridLayout Stretch my JTextFields..." Watch "GridLayout Stretch my JTextFields..." New topic
Author

GridLayout Stretch my JTextFields...

Julio Cesar Marques
Ranch Hand

Joined: Mar 21, 2009
Posts: 66
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!


Julio Cesar Lopes Marques
Sun Certified Java Developer 5, Sun Certified Java Programmer 5
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 1973
    
    7

For GridLayouts, the components stretches to fill the space. You can put the JTextField onto a JPanel then put this JPanel to the GridLayout.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GridLayout Stretch my JTextFields...
 
Similar Threads
mouse event
Reg:Applet to servlet Communication
Reg : getting Values from applet using jsp
Exception in thread
WA #1.....word association