469,356 Members | 2,055 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

How to convert a TextArea to a String?

I need to convert a TextArea to a String, and the replace the letter "a" in the string by a "f";
I have:
JTextArea Text1 = new JTextArea();
String Text2;
???????? here's where i convert the textarea to a srting ??????????
Text2 = null;
Text2 = Text1.replaceAll("a", "e");

I haved tried:
String Text2 = CriptoText.getElementById("Text1");

Thank you for your help
Oct 16 '09 #1
4 11986
13,262 8TB
Read the API specs for the classes you are using rather than cross posting the same question on many forums.
Oct 16 '09 #2
I already sis but i cant really understand thats why i ask, and if i have 100 thousand forums with the same quiestion is my problem i want a respond thats why i do it...And i only have 2 forums with the same question...
Oct 16 '09 #3
Are you trying to convert JtextArea() object in to a string or something else?
Oct 18 '09 #4
Haven't tested it, but quite sure this works:

Expand|Select|Wrap|Line Numbers
  1. JTextArea TextArea = new JTextArea();
  2. String text1 = TextArea.getText();
  3. String text2 = text1.replaceAll("a", "e");
Oct 18 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Convert TextBox.Text to Int32 Problem | last post: by
4 posts views Thread by Ken Varn | last post: by
15 posts views Thread by Yifan | last post: by
3 posts views Thread by priyanka | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.