WidgetWindow.java Source code

Java tutorial

Introduction

Here is the source code for WidgetWindow.java

Source

/*
SWT/JFace in Action
GUI Design with Eclipse 3.0
Matthew Scarpino, Stephen Holder, Stanford Ng, and Laurent Mihalkovic
    
ISBN: 1932394273
    
Publisher: Manning
*/

import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;

public class WidgetWindow extends ApplicationWindow {
    public WidgetWindow() {
        super(null);
    }

    protected Control createContents(Composite parent) {
        getShell().setText("Widget Window");
        parent.setSize(400, 250);
        return parent;
    }

    public static void main(String[] args) {
        WidgetWindow wwin = new WidgetWindow();
        wwin.setBlockOnOpen(true);
        wwin.open();
        Display.getCurrent().dispose();
    }
}