MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

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();
    }
}