Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get the info from a jtextarea

 
keiyia jackson
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, that worked
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic