UiButton events

I have looked around to figure out how to detect when a UiButton is pressed. Does anybody know of an example or how this is done?
tomcat

During an update call it checks the input object that you set during it creation. If it is “hit” it calls any actions you set the the object. See jmetest.ui.TestUI.

Not sure if I got this right. Created a couple of UiButtons and added them to a node and attached to the rootNode which is updated every cycle. Created a InputHandler but dont seem to figure out how to catch the button press event from the buttons (you can catch KeyBoardActions which is not the same).

I created an AbsoluteMouse and set the cursor etc and then added that to the InputHandler but cant see the mouse either.

Any ideas where to go next?
tomcat

from a quick view into the code it seems that the UIButton gets a reference to the inputSystem at creation.

then at runtime UIButton.update(float) is called each logic cycle.

The key however seem to lie in the mouse - setup:

/*
* The absolute mouse
*/
mouse = new AbsoluteMouse(“Mouse Input”, display.getWidth(), display
.getHeight());
TextureState cursor = display.getRenderer().createTextureState();
cursor.setEnabled(true);
cursor.setTexture(TextureManager.loadTexture(TestAbsoluteMouse.class
.getClassLoader()
.getResource(“jmetest/data/cursor/cursor1.png”),
Texture.MM_LINEAR, Texture.FM_LINEAR, true));

    /*
     * Add the cursor texture to the mouse
     */
    mouse.setRenderState(cursor);
    /*
     * Add the alpha state to the mouse
     */
    mouse.setRenderState(as2);
    mouse.setMouseInput(InputSystem.getMouseInput());

    /*
     * Set the speed of the mouse
     */
    mouse.setSpeed(2.0f);
    /*
     * Set the mouse that the inputHandler is using so the UIObjects can
     * retrieve it
     */
    input.setMouse(mouse);

hth
Martin