Java by API/org.eclipse.swt.widgets/Decorations
Содержание
- 1 new Decorations(shell, SWT.BORDER)
- 2 new Decorations(shell, SWT.CLOSE)
- 3 new Decorations(shell, SWT.MAX)
- 4 new Decorations(shell, SWT.MIN)
- 5 new Decorations(shell, SWT.NO_TRIM)
- 6 new Decorations(shell, SWT.ON_TOP)
- 7 new Decorations(shell, SWT.RESIZE)
- 8 new Decorations(shell, SWT.TITLE)
- 9 new Decorations(shell, SWT.TOOL)
new Decorations(shell, SWT.BORDER)
<source lang="java">
import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Decorations; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class MainClass {
public static void main(String[] a) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Sash One");
// The SWT.BORDER style Decorations d = new Decorations(shell, SWT.BORDER); d.setLayoutData(new GridData(GridData.FILL_BOTH)); d.setLayout(new FillLayout()); Label l = new Label(d, SWT.CENTER); l.setText("SWT.BORDER"); d.setBounds(20,20,100,100); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
}
</source>
new Decorations(shell, SWT.CLOSE)
<source lang="java">
import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Decorations; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class MainClass {
public static void main(String[] a) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Sash One");
// The SWT.BORDER style Decorations d = new Decorations(shell, SWT.CLOSE); d.setLayoutData(new GridData(GridData.FILL_BOTH)); d.setLayout(new FillLayout()); Label l = new Label(d, SWT.CENTER); l.setText("SWT.CLOSE"); d.setBounds(20,20,100,100); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
}
</source>
new Decorations(shell, SWT.MAX)
<source lang="java">
import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Decorations; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class MainClass {
public static void main(String[] a) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Sash One");
// The SWT.BORDER style Decorations d = new Decorations(shell, SWT.MAX); d.setLayoutData(new GridData(GridData.FILL_BOTH)); d.setLayout(new FillLayout()); Label l = new Label(d, SWT.CENTER); l.setText("SWT.MAX"); d.setBounds(20,20,100,100); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
}
</source>
new Decorations(shell, SWT.MIN)
<source lang="java">
import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Decorations; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class MainClass {
public static void main(String[] a) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Sash One");
// The SWT.BORDER style Decorations d = new Decorations(shell, SWT.MIN); d.setLayoutData(new GridData(GridData.FILL_BOTH)); d.setLayout(new FillLayout()); Label l = new Label(d, SWT.CENTER); l.setText("SWT.MIN"); d.setBounds(20,20,100,100); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
}
</source>
new Decorations(shell, SWT.NO_TRIM)
<source lang="java">
import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Decorations; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class MainClass {
public static void main(String[] a) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Sash One");
// The SWT.BORDER style Decorations d = new Decorations(shell, SWT.NO_TRIM); d.setLayoutData(new GridData(GridData.FILL_BOTH)); d.setLayout(new FillLayout()); Label l = new Label(d, SWT.CENTER); l.setText("SWT.NO_TRIM"); d.setBounds(20,20,100,100); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
}
</source>
new Decorations(shell, SWT.ON_TOP)
<source lang="java">
import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Decorations; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class MainClass {
public static void main(String[] a) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Sash One");
// The SWT.BORDER style Decorations d = new Decorations(shell, SWT.ON_TOP); d.setLayoutData(new GridData(GridData.FILL_BOTH)); d.setLayout(new FillLayout()); Label l = new Label(d, SWT.CENTER); l.setText("SWT.ON_TOP"); d.setBounds(20,20,100,100); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
}
</source>
new Decorations(shell, SWT.RESIZE)
<source lang="java">
import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Decorations; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class MainClass {
public static void main(String[] a) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Sash One");
// The SWT.BORDER style Decorations d = new Decorations(shell, SWT.RESIZE); d.setLayoutData(new GridData(GridData.FILL_BOTH)); d.setLayout(new FillLayout()); Label l = new Label(d, SWT.CENTER); l.setText("SWT.RESIZE"); d.setBounds(20,20,100,100); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
}
</source>
new Decorations(shell, SWT.TITLE)
<source lang="java">
import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Decorations; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class MainClass {
public static void main(String[] a) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Sash One");
// The SWT.BORDER style Decorations d = new Decorations(shell, SWT.TITLE); d.setLayoutData(new GridData(GridData.FILL_BOTH)); d.setLayout(new FillLayout()); Label l = new Label(d, SWT.CENTER); l.setText("SWT.TITLE"); d.setBounds(20,20,100,100); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
}
</source>
new Decorations(shell, SWT.TOOL)
<source lang="java">
import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Decorations; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class MainClass {
public static void main(String[] a) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Sash One");
// The SWT.BORDER style Decorations d = new Decorations(shell, SWT.TOOL); d.setLayoutData(new GridData(GridData.FILL_BOTH)); d.setLayout(new FillLayout()); Label l = new Label(d, SWT.CENTER); l.setText("SWT.TOOL"); d.setBounds(20,20,100,100); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
}
</source>