[jnc-users] SWT compile issue
Status: Beta
Brought to you by:
soapy
|
From: Jer A <jer...@ho...> - 2007-03-31 08:13:12
|
hello all, here is an SWT sample.
Why is it taking so looonnnnnnng to compile....does it really have to
process the entire swt.jar? even for reference?
thanks in advance for all your help.
-Jer A.
--------------------------------------------
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.graphics.Rectangle;
public class cexample2 {
public static void main(String [] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.addPaintListener(new PaintListener() {
public void paintControl (PaintEvent e) {
test.shell = shell;
test.paint(e);
}
});
shell.setBounds(10, 10, 200, 200);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
static
{
Class c;
//c = javax.swing.plaf.metal.MetalLookAndFeel.class;
c = org.eclipse.swt.widgets.Canvas.class;
c = org.eclipse.swt.widgets.Display.class;
c = org.eclipse.swt.widgets.Shell.class;
c = org.eclipse.swt.events.PaintListener.class;
//c = javax.media.j3d.WakeupOnActivation.class;
}
}
class test {
public static Shell shell = null;
public static void paint(PaintEvent event) {
Rectangle rect = shell.getClientArea();
event.gc.drawOval(0, 0, rect.width - 1, rect.height - 1);
}
}
_________________________________________________________________
RealLiveMoms: Share your experience with Real Live Moms just like you
http://www.reallivemoms.ca/
|