Q:

Java WebDriver: How can I obtain an instance of a Coordinates class?

I am trying to automate a GWT web app and standard clicks on a button don't work.
Therefore, I am simulating mouse events instead.
The code examples found online:
Mouse mouse = ((HasInputDevices)driver).getMouse();
mouse.mouseDown((Coordinates)myButton.getLocation());
mouse.mouseUp((Coordinates)myButton.getLocation());

But then I get:
Exception in thread "main" java.lang.ClassCastException: Point cannot be cast to Coordinates

How can I obtain a valid instance of a Coordinates object?

A:

This is how you do it.. 
Locatable button = (Locatable) myButton;
Mouse mouse = ((HasInputDevices)driver).getMouse();
mouse.mouseDown(button.getCoordinates());
mouse.mouseUp(button.getCoordinates());

