Example usage for org.eclipse.swt.custom StyledText setEditable

List of usage examples for org.eclipse.swt.custom StyledText setEditable

Introduction

In this page you can find the example usage for org.eclipse.swt.custom StyledText setEditable.

Prototype

public void setEditable(boolean editable) 

Source Link

Document

Sets whether the widget content can be edited.

Usage

From source file:StyledTextReadOnly.java

public static void main(String[] args) {
    final Display display = new Display();
    final Shell shell = new Shell(display);

    StyledText styledText = new StyledText(shell, SWT.V_SCROLL | SWT.BORDER);
    styledText.setText("12345");

    styledText.setEditable(false);

    styledText.setBounds(10, 10, 100, 100);
    shell.open();/*from   w  ww  . j  a v  a 2s.co  m*/
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    display.dispose();

}