如何创建无法选择的只读SWT文本?(通过键盘和鼠标)

San*_*ejű 2 swt select text readonly

如何创建无法选择的只读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. 
Run Code Online (Sandbox Code Playgroud)

Mar*_*ato 6

请改用标签.或者使用Text setEnabledsetEditable方法.