Maxim Bjjtwins
Maxim Bjjtwins

Reputation: 108

Get current mouse position

It would seem a simple task, but I'm looking at a couple pair tens forums and haven't found the solution. How can I get the current mouse position in LWUIT?

Only here it is:

PointerInfo a = MouseInfo.getPointerInfo ();
Point point = new Point (a.getLocation ());

But it is not suitable for JavaME.

Are there other ways?

Upvotes: 0

Views: 416

Answers (1)

user833129
user833129

Reputation:

In LWUIT you can register your Form with the pointerListener : yourForm.addPointerPressedListener(this); , then you implement the code of the public void pointerPressed(int x, int y) method. And the x and y are the position you are looking for. So you must click the screen to obtain these values , that is the device is a tactile one.

Upvotes: 3

Related Questions