require 'java' require 'org.eclipse.swt.win32.win32.x86_3.6.1.v3655c.jar' import 'org.eclipse.swt.SWT' import 'org.eclipse.swt.widgets.Display' import 'org.eclipse.swt.widgets.Shell' import 'org.eclipse.swt.widgets.Label' import 'org.eclipse.swt.layout.FillLayout' @display = Display.new @shell = Shell.new(display) @shell.setText("Hello, World") @layout = FillLayout.new(SWT::VERTICAL) @shell.setLayout(@layout) @label = Label.new(@shell,SWT::BORDER) @label.setText("Hello, SWT World!") @shell.setSize( 640, 480 ) @shell.open while (!@shell.isDisposed) do if (!@display.readAndDispatch) then @display.sleep end end @display.dispose