List of usage examples for org.eclipse.swt.widgets Display dispose
public void dispose()
From source file:org.eclipse.swt.snippets.Snippet37.java
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Snippet 37"); shell.setLayout(new FillLayout()); new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL); new Label(shell, SWT.SEPARATOR | SWT.VERTICAL); shell.setSize(200, 200);/*from w ww. j a va 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 w ww . ja v a 2 s .c om 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.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. ja va 2 s.c o m shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
From source file:CreateMultipleLineText.java
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); // Create a multiple-line text field Text t = new Text(shell, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL); t.setLayoutData(new GridData(GridData.FILL_BOTH)); shell.open();/*from www . ja va 2 s . 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 ww .j a v a2 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: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 ww w . j av a 2 s. c o m*/ bar.pack(); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
From source file:StyledTextReplaceTextRange.java
public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); final StyledText styledText = new StyledText(shell, SWT.V_SCROLL | SWT.BORDER); styledText.setText("12345"); styledText.replaceTextRange(2, 3, "A"); styledText.setBounds(10, 10, 100, 100); shell.open();//from ww w . j a v a 2 s. c o m while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
From source file:HorizontalSeparatorLabelExample.java
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(); shell.setLayout(new GridLayout(1, false)); // Create a horizontal separator Label separator = new Label(shell, SWT.HORIZONTAL | SWT.SEPARATOR); separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); shell.open();//w ww .j av a 2 s . c om while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
From source file:StyledTextKeyBound.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 zAction = styledText.getKeyBinding('z'); styledText.setBounds(10, 10, 100, 100); shell.open();/*www.j a va2 s .c om*/ while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
From source file:org.eclipse.swt.snippets.Snippet261.java
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Excel Example"); shell.setLayout(new FillLayout()); try {//from ww w . jav a2 s. c om OleFrame frame = new OleFrame(shell, SWT.NONE); new OleClientSite(frame, SWT.NONE, "Excel.Sheet"); addFileMenu(frame); } catch (SWTError e) { System.out.println("Unable to open activeX control"); display.dispose(); return; } shell.setSize(800, 600); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }