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 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 Spring in Action this week in the Spring 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get the info from a jtextarea