58,454
社区成员
发帖
与我相关
我的任务
分享
Shell.setCursor(new Cursor(Cursor.WAIT_CURSOR));
public static void main(String[] args) {
Display display = new Display();
final Cursor cursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = new Shell(display);
shell.open();
final Button b = new Button(shell, 0);
b.setBounds(10, 10, 120, 30);
b.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
b.setCursor(cursor);
}
});
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
cursor.dispose();
display.dispose();
}