File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes multiline textfield Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "multiline textfield" Watch "multiline textfield" New topic

multiline textfield

Annalisa Annalisa

Joined: Mar 07, 2005
Posts: 6
How can I specify a text field (JTExtField) as multiline? I mean that the user input doesn't expand horizontally but it automatically goes down a line?

Thank you
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
You can't! Use JTextArea instead.

James Carman, President<br />Carman Consulting, Inc.
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
The first line of the JTextField documentation reads: "JTextField is a lightweight component that allows the editing of a single line of text."

What you want is a JTextArea
Annalisa Annalisa

Joined: Mar 07, 2005
Posts: 6
ok..sorry! :roll:
thank you
I agree. Here's the link:
subject: multiline textfield
It's not a secret anymore!