my dog learned polymorphism*
The moose likes Swing / AWT / SWT and the fly likes How To make Button Display in JTextarea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How To make Button Display in JTextarea" Watch "How To make Button Display in JTextarea" New topic
Author

How To make Button Display in JTextarea

Sean Magee
Ranch Hand

Joined: Aug 23, 2004
Posts: 69
How do i get a something to display in the JTextArea?

Here is an example of my code




Now everytime I hit south, How do i get something to display in the TextArea?
Sainath Veepuri
Ranch Hand

Joined: Sep 25, 2003
Posts: 49
Hi Sean,
Use the setText method to insert the text you wanted to display.
Was this what you wanted?
- Sai
Sean Magee
Ranch Hand

Joined: Aug 23, 2004
Posts: 69


Something like that right?

Well yeah I tried that and I get::


This happens when I use the Append method too.
JTextArea is imported, and is global
[ December 08, 2004: Message edited by: Sean Magee ]
sasi kala
Ranch Hand

Joined: Dec 17, 2004
Posts: 68
Hi sean,

setText is not a variable its a method,

To setText use text.setText("...");
To append to use text.append("...");

All The Best.
 
wood burning stoves
 
subject: How To make Button Display in JTextarea
 
Similar Threads
JScrollPane not working
No Scroll Bar coming in JTextArea
GUI doesnt show
How to set paddings?
nothing shows. what did i forget?