如何创建无法选择的只读 SWT 文本? (通过键盘和鼠标)
例如:
Text text = new Text(shell, SWT.BORDER | SWT.READ_ONLY);
text.append("text text text text text text text text text text text text text ");
text.setSelection(10, 60); // If only I could write here something that could turn the text impossible to select, just like if it were a label.
最佳答案
改用标签。或者使用 Text 的 setEnabled
和 setEditable
方法。
关于select - 如何创建无法选择的只读 SWT 文本? (通过键盘和鼠标),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8574187/