How to empty the contents of a JTextArea or assign a value with another string, how to set it to be non-editable

Source: Internet
Author: User
How to empty the contents of a JTextArea or assign a value with another string. And how to set it to be non-editable.
1. How to empty the contents of the JTextArea or assign values with other strings. And how to set it to be non-editable.


There are no such methods in the class, only one Replacerange (String str, int start, int end), but that end seems very difficult to know what value to use. I'm going to replace it all.
2.Re: How to empty the contents of the JTextArea or assign values with other strings. And how to set it to be non-editable.


JTextArea TA1 = new JTextArea ();
1) Empty:
Ta1.settext ("");
2) Other strings such as: STR1
Ta1.settext (STR1);
3) Not editable:
Ta1.seteditable (FALSE);
3.Re: How to empty the contents of the JTextArea or assign values with other strings. And how to set it to be non-editable.


JTextArea is the sub-class of jtextcomponent I can use all the method defined in the jtextcomponent, such as SetText ( NULL), Seteditable (Boolean), etc.
4.Re: How to empty the contents of the JTextArea or assign values with other strings. And how to set it to be non-editable.

Shsen,java API Doc is very helpful. Recommend to download and take it as reference while coding. You can find all of the APIs you want.
5.Re: How to empty the contents of a JTextArea or assign a value with another string. And how to set it to be non-editable. ]

Looker wrote :
Shsen,java API Doc is very helpful. Recommend to download and take it as reference while coding. You can find all of the APIs you want.


Nod, but I often use the CHM format API Doc, the advantage is directly in the index bar input setsize, will be reversed to the corresponding apidoc, more efficient
The other is JBuilder plus Productitypro plugin, which shows the cursor API Doc

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.