import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
public class SystemSettingChangeListener {
public static void main(String[] args) {
final Display display = new Display();
Shell shell = new Shell(display);
display.addListener(SWT.Settings, new Listener() {
public void handleEvent(Event event) {
System.out.println("Setting changed");
}
});
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
|