M. Rogers M. Rogers - 11 months ago 50
Java Question

What is the SWT equivalent of MouseMotionListener that's in AWT?

I am converting a project over from AWT to SWT. The original project uses the

method in the MouseMoitionListener class. I've noticed the MouseListener class in SWT only has
MouseDown(), MouseUp()
Is there an SWT motion listener? If not does anyone have any ideas?


Answer Source

Use MouseMoveListener which gives you the movement events.

You will probably also need to use MouseListener to get the mouse button up / down events.

Alternatively you can use the lower level addListener method for the SWT.MouseMove, SWT.MouseDown and SWT.MouseUp events.