This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes JTextField Word Wrap?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextField Word Wrap??" Watch "JTextField Word Wrap??" New topic
Author

JTextField Word Wrap??

Mike Smike
Ranch Hand

Joined: Aug 25, 2004
Posts: 33
Hi guys

I have a number of JTextFields, and in each there is a bit of text information. The problem is is that the text just disappears off the side of the JTextField. How can I make the text wrap inside the Field, so that all the information fits inside the box. I tried /n in the string but that didn't work

Please help

Thanks buddies

Mike
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
1st line of JTextField javadoc :
JTextField is a lightweight component that allows the editing of a single line of text

Use a JTextArea instead.
D.
Mike Smike
Ranch Hand

Joined: Aug 25, 2004
Posts: 33
Ah yes... thanks

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JTextField Word Wrap??