extends ApplicationWindow
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
public class MainClass extends ApplicationWindow {
public MainClass() {
super(null);
}
public void run() {
setBlockOnOpen(true);
open();
Display.getCurrent().dispose();
}
protected Control createContents(Composite parent) {
Label label = new Label(parent, SWT.CENTER);
label.setText("Hello, World");
return label;
}
public static void main(String[] args) {
new MainClass().run();
}
}
Related examples in the same category