All pastes #561242 Raw Edit

Untitled

public text v1 · immutable
·published 2007-06-12 11:40 UTC
rendered paste body
//package org.eclipse.ui.tools;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class RunAway {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Display display = Display.getDefault();
		Shell shell = new Shell(display);
		shell.setSize(400, 300);
		Text text = new Text(shell, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY
				| SWT.H_SCROLL);
		text.setBounds(5, 5, 200, 100);
		text
				.setText("Take my love, take my land, take me where I cannot stand.  I don't care, I'm still free, you can't take the sky from me\nTake me out, to the black, tell them I ain't commin' back");
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		display.dispose();
	}

}