List of usage examples for org.eclipse.swt.custom StyledText setTextLimit
public void setTextLimit(int limit)
From source file:StyledTextLimit.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.setTextLimit(10); styledText.setBounds(10, 10, 100, 100); shell.open();// www. j a va 2s . co m while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }