Adding text to a Multiline textarea

Posted on 2003-03-20
Medium Priority
Last Modified: 2010-04-17
What is the best and easiest way to insert new lines of text into a multilined textbox.  I just need to append text everytime a button is clicked.

Question by:prymak
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
  • 3
  • 2
LVL 30

Expert Comment

by:Mayank S
ID: 8172422
>> multilined textbox

You mean, a TextArea right?

Just use the append () method defined by TextArea. It takes the string to be appended as an argument.


LVL 30

Expert Comment

by:Mayank S
ID: 8172433
Let mytextarea be the TextArea object.

public void actionPerformed ( ActionEvent ae )
  if ( ae.getSource () == somebutton ) // which-ever you click upon & then the text is to be added
    mytextarea.append ( "This is the text to be appended. " ) ; // end if

} // end of actionPerformed ()


Author Comment

ID: 8174951
I did mean textbox.  I created a textbox named faqsheet.
then made it multilined,


I need to add text to this textbox without destroying whats there.  There is no append method.

Author Comment

ID: 8175003
I thought I had posted this question in the right place, I just realized this isnt the Visual Basic forum.  The language I am workin in is VB
LVL 30

Accepted Solution

Mayank S earned 220 total points
ID: 8178875
You can try:

faqsheet.Text = faqsheet.Text & "This is the text which will be appended. "

I guess that should help you!


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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Six Sigma Control Plans
Suggested Courses

777 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