(import (org.eclipse.swt SWT) (org.eclipse.swt.widgets Display) (org.eclipse.swt.widgets Shell) (org.eclipse.swt.widgets Label) (org.eclipse.swt.layout FillLayout) (org.eclipse.swt.events ShellAdapter)) (def display (Display.)) (def shell (Shell. display)) (def layout (FillLayout. SWT/VERTICAL)) (def label (Label. shell SWT/BORDER)) (doto label (.setText "Hello, SWT World!")) (doto shell (.setText "Hello, World") (.setLayout layout) (.setSize 640 480) (.addShellListener (proxy [ShellAdapter] [] (shellClosed [evt] (System/exit 0)))) (.open)) (defn while-loop [display shell] (loop [] (if (.isDisposed shell) (.dispose display) (do (if (not (.readAndDispatch display)) (.sleep display)) (recur))))) (while-loop display shell))