Simple Jacl/SWT example

Neil Madden supplies an apt sample [L1 ].

  # simple Jacl/SWT example
  package require java

  java::import -package org.eclipse.swt SWT
  java::import -package org.eclipse.swt.widgets Display Shell Label

  set display [java::new Display]
  set shell   [java::new Shell $display]
  set label   [java::new Label $shell [java::field SWT NONE]]

  $label setText "Hello, World!"
  $label pack
  $shell pack
  $shell open
  while {![$shell isDisposed]} {
      if {![$display readAndDispatch]} { $display sleep }
  }
  $display dispose