List of usage examples for org.eclipse.swt.widgets Display sleep
public boolean sleep()
From source file:org.eclipse.swt.snippets.Snippet346.java
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); shell.setText("Snippet 346"); Text text = new Text(shell, SWT.PASSWORD | SWT.BORDER); text.setTextChars(new char[] { 'p', 'a', 's', 's' }); shell.pack();/*from ww w . j ava 2 s . c om*/ shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
From source file:MainClass.java
public static void main(String[] a) { Display d = new Display(); Shell s = new Shell(d); s.setSize(250, 250);//from www . j a v a 2s.c o m s.setText("A Combo Example"); final Combo c = new Combo(s, SWT.READ_ONLY); c.setBounds(50, 50, 150, 65); String items[] = { "Item One", "Item Two", "Item Three", "Item Four", "Item Five" }; c.setItems(items); s.open(); while (!s.isDisposed()) { if (!d.readAndDispatch()) d.sleep(); } d.dispose(); }
From source file:org.eclipse.swt.examples.controlexample.CustomControlExample.java
/** * Invokes as a standalone program./*from w w w .j av a 2 s . com*/ */ public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); CustomControlExample instance = new CustomControlExample(shell); shell.setText(getResourceString("custom.window.title")); setShellSize(instance, shell); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } instance.dispose(); }
From source file:ArrowButtonExample.java
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(3, true)); // Create three arrow buttons new Button(shell, SWT.ARROW); new Button(shell, SWT.ARROW | SWT.LEFT); new Button(shell, SWT.ARROW | SWT.DOWN); shell.pack();/*from w w w . j a v a2 s. co m*/ shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
From source file:ToolBarVertical.java
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); ToolBar bar = new ToolBar(shell, SWT.BORDER | SWT.VERTICAL); for (int i = 0; i < 4; i++) { ToolItem item = new ToolItem(bar, 0); item.setText("Item " + i); }/*from www . jav a2 s .co m*/ bar.pack(); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
From source file:StyledTextActionBound.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"); int altEAction = styledText.getKeyBinding('e' | SWT.ALT); styledText.setBounds(10, 10, 100, 100); shell.open();/*from w w w . j a va2s . co m*/ while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
From source file:MainClass.java
public static void main(String[] a) { final Display d = new Display(); final Shell shell = new Shell(d); shell.setSize(250, 200);//w w w . j av a 2 s.c om shell.setLayout(new FillLayout()); Canvas drawingCanvas = new Canvas(shell, SWT.NONE); drawingCanvas.addPaintListener(new ArcExamplePaintListener()); drawingCanvas.redraw(); shell.open(); while (!shell.isDisposed()) { if (!d.readAndDispatch()) d.sleep(); } d.dispose(); }
From source file:StyledTextSetKeyBinding.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.setKeyBinding('i' | SWT.ALT, ST.TOGGLE_OVERWRITE); styledText.setBounds(10, 10, 100, 100); shell.open();//from w w w .j a v a 2 s . c o m while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
From source file:DialogShellPositionIt.java
public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); Shell dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); Point pt = display.getCursorLocation(); dialog.setLocation(pt.x, pt.y);//from ww w . jav a 2 s. c om dialog.setText("Dialog Shell"); dialog.setSize(100, 100); dialog.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
From source file:ToolItemButtonPush.java
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); ToolBar bar = new ToolBar(shell, SWT.BORDER | SWT.VERTICAL); for (int i = 0; i < 4; i++) { ToolItem item = new ToolItem(bar, SWT.PUSH); item.setText("Item " + i); }//from w w w . j a v a 2 s. c o m bar.pack(); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }