This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes how to get the info from a 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 get the info from a jtextarea" Watch "how to get the info from a jtextarea" New topic
Author

how to get the info from a jtextarea

keiyia jackson
Ranch Hand

Joined: Jul 16, 2001
Posts: 49
i want that info placed in a buffer so it can be sent to c++ program and the string parsed using the jni. i am not concerned with the latter part. just want to know how to get the text into a buffer and back out to another text area.
thanks
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
You can simply get the text from the JTextArea and use it to construct the buffer:
//(I assume jta is a JTextArea)
StringBuffer stB= new StringBuffer(jta.getText());
//..your code to operate with the buffer...
//and insert the text into another JTextArea
JTextArea anotherJTA= new JTextArea(stB.toString());

-HTH
Juanjo
keiyia jackson
Ranch Hand

Joined: Jul 16, 2001
Posts: 49
thanks, that worked
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to get the info from a jtextarea
 
Similar Threads
How do I copy and paste to a text file?
input file and output file
how to get the info from a jtextarea
FBNS: convert readUTF to NIO equivalent
Showing JSP output in XSL