Change X/Y - Position of Element in Java-Code? Also: Hiding the mouse in the Menu?


I have an Image that I want to use as “cursor” for my menu GUI. In the InputListener, I call this method:

[java]public void updateCursor()


Element cursor = nifty.getScreen(“start”).findElementByName(“cursor”);


Now, is there a Method/Class that lets me change the Y-Position of the element “cursor” ?

My second problem is that I don’t want my mouse cursor to show in the Menu, is there a way to accomplish this?

It all depends on the layout of the parent panel but things like cursor.setYConstraint() and cursor.setY() will probably help…

cursor.setY() doesn’t exist and cursor.setConstraintY() doesn’t seem to work

After setting the constraint you need to relayout the parent component. cursor.getParent().layoutElements() or something.

Thank you very much, it’s working now :3