简体   繁体   English

如何将文本设置为禁用的 JTextArea

[英]How to Set Text To a disabled JTextArea

I want some help on how to paste a copied String to a disabled JTextArea .我想要一些关于如何将复制的String粘贴到禁用的JTextArea

I'm trying to do:我正在尝试做:

Input.copy();
ExprTextArea.paste();

Where input is the String to be copied and ExprTextArea is the element which the copied String must be pasted.其中 input 是要复制的StringExprTextArea是复制的String必须粘贴的元素。

try this尝试这个

ExprTextArea.append("Text"); //append will work in this Case.

because setText() Method will not work because of Disabled.因为setText()方法会因为 Disabled 无法工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM