Anonymous
public text v1 · immutable public static void main(String [] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
Canvas canvas = new Canvas(shell, SWT.NONE);
canvas.addListener(SWT.MouseWheel, new Listener() {
public void handleEvent(Event event) {
System.out.println("Wheel: " + event.count);
}
});
shell.open();
while(!shell.isDisposed()) {
if(!display.readAndDispatch()) display.sleep();
}
display.dispose();
}