您的位置:首页 > 其它

如何把JTextArea里的内容清空或用其他字符串赋值,怎么设成不可编辑

2009-01-12 14:28 323 查看

如何把JTextArea里的内容清空或用其他字符串赋值?还有怎么设成不可编辑?

1.如何把JTextArea里的内容清空或用其他字符串赋值?还有怎么设成不可编辑?
该类里没有这些方法,只有一个replaceRange(String str, int start, int end),但那个end好象很难知道用什么值。我要全部替换。
2.Re:如何把JTextArea里的内容清空或用其他字符串赋值?还有怎么设成不可编辑?
JTextArea TA1 = new JTextArea();
1)清空:
TA1.setText("");
2)其它串如:Str1
TA1.setText(Str1);
3)不可编辑:
TA1.setEditable(false);
3.Re:如何把JTextArea里的内容清空或用其他字符串赋值?还有怎么设成不可编辑?
JTextArea is the sub-class of JTextComponent so you can use all the method defined in the JTextComponent, such as setText(null), setEditable(boolean), etc.
4.Re:如何把JTextArea里的内容清空或用其他字符串赋值?还有怎么设成不可编辑?
shsen,java api doc is very helpful. Recommend you to download and take it as reference while coding. You can find all of the api you want .
5.Re:如何把JTextArea里的内容清空或用其他字符串赋值?还有怎么设成不可编辑? ]
looker wrote:
shsen,java api doc is very helpful. Recommend you to download and take it as reference while coding. You can find all of the api you want .

nod, 不过我经常用的是chm格式的api doc, 好处是直接在索引栏中输入setSize,就会调转到相应的apidoc, 效率比较高
另外一个就是JBuilder加上ProductityPro插件, 显示光标的api doc
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: