Community
Participate
Working Groups
When invoking add field quick fix inside a static method such as main(Sting[]), the field added must be static. Use quick fix to define the field "lastMouseMove" in the encapsulating class. public static void main(String[] args) { Display display = new Display(); final Shell shell = new Shell(display, SWT.SHELL_TRIM | SWT.RIGHT_TO_LEFT); shell.setText("Shell"); shell.addMouseMoveListener(new MouseMoveListener() { public void mouseMove(MouseEvent e) { lastMouseMove = new Point(e.x,e.y); } });