0

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?

gnat
  • 6,213
  • 108
  • 53
  • 73
Maxim Bjjtwins
  • 108
  • 1
  • 8

1 Answers1

3

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.

  • 1
    Correct. Also keep in mind that with touch events there is no right mouse button or hover concept (except for the short lived blackberry storm) hence there is no need for more elaborate pointer data. – Shai Almog Sep 19 '11 at 11:10