Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Multiline textarea

Posted on 1997-03-23
4
Medium Priority
?
867 Views
Last Modified: 2006-11-17
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
Comment
Question by:lptsang3
4 Comments
 
LVL 2

Expert Comment

by:webster030697
ID: 1218970
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
 

Expert Comment

by:dingdang
ID: 1218971
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
 

Accepted Solution

by:
IsaacW earned 40 total points
ID: 1218972
lptsang3,

use this code:

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

hope this helps.
0
 

Author Comment

by:lptsang3
ID: 1218973
Edited text of question
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question