[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 869
  • Last Modified:

Multiline textarea

I am just getting started with java.

I can't get the textarea to use multiple lines. The 3 rows are displayed but, I am expected an 'enter' key to bring the user to 2nd line.

TextArea ta = new TextArea(5,50);
-this only show a work space but the edited text will not swap to the next line
0
lptsang3
Asked:
lptsang3
1 Solution
 
webster030697Commented:
That's pretty much how it works (in JDK 1.0.2 anyway). You could write your own TextArea class:

public class MyTextArea extends TextArea
{  //do what you want
}

Have fun!
0
 
dingdangCommented:
I guess I don't understand the problem. When you are in the first line and press Enter key, you WILL BE in second line.
0
 
IsaacWCommented:
lptsang3,

use this code:

TextArea tarea;
tarea = new TextArea(columns, rows);
add(tarea);

hope this helps.
0
 
lptsang3Author Commented:
Edited text of question
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now