Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multiline textarea

Posted on 1997-03-23
4
Medium Priority
?
864 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

730 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