M. Rogers M. Rogers - 3 months ago 19
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

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

Thanks

Answer

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.