File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextField Word Wrap??" Watch "JTextField Word Wrap??" New topic

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

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.
Mike Smike
Ranch Hand

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

I agree. Here's the link:
subject: JTextField Word Wrap??
It's not a secret anymore!