File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How To make Button Display in JTextarea
 
Similar Threads
No Scroll Bar coming in JTextArea
nothing shows. what did i forget?
JScrollPane not working
How to set paddings?
GUI doesnt show