All pastes #21943 Raw Edit

Mine

public text v1 · immutable
#21943 ·published 2005-09-02 15:43 UTC
rendered paste body
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;

public class PathBugDemo
{
	public static void main(String[] args)
	{
		final Display display = new Display();
		final Shell shell = new Shell(display);
		
		shell.addListener(SWT.Paint, new Listener() {
			public void handleEvent(Event event) {
				GC gc = event.gc;				
				Path path = new Path(display);
				gc.drawPath(path);
				gc.drawRoundRectangle(10, 10, 100, 100, 10, 10);
				path.dispose();
			}			
		});
		
		shell.setSize(300, 300);
		shell.open();
		
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}

		display.dispose();
	}
}