Writing a Hello World JFace application

Main.java:

import org.eclipse.jface.window.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.*;
 
public class Main extends ApplicationWindow 
{
   public Main() {
      super(null);
   }
   
   protected Control createContents(Composite parent) {
      Label label = new Label(parent, SWT.PUSH);
      label.setText("Hello, world!");
      return label;
   }
   
   public static void main(String []args) {
      Main main = new Main();
      main.setBlockOnOpen(true);
      main.open();
      
      Display.getCurrent().dispose();
   }
}