HelloJMEDesktop button don't react

I'm using an unmodified version of HelloJMEDesktop directly from the latest CVS, and the JButton in the middle of the screen do not react to any listeners; not the ActionListener and not JMEAction. When I hover over the button it isn't even highlighted.

Nobody else seems to have experinced this problem - what could be wrong?

can you post up the code that adds the desktop, node and the button

Posting the code is not necessary if it's the version from cvs.

oops, just tested it over here and it's the same :-o

Thanks for reporting it - I will have a look later…

Any update on this issue?  :slight_smile:

No, I didn't find the time yet… hang on :expressionless:

… or try to find out :slight_smile:

Ok, fixed in CVS. Mouse position conversion was wrong.

Sorry it took that long.

irrisor said:

Ok, fixed in CVS. Mouse position conversion was wrong.

Yeah, now it works perfectly - thanks!!  :D

The JMEDesktop package is brilliant! Very well tought out and implemented; amazing that Swing can be utilized this way.

It makes it possible to make Doom 3 like GUI’s in zero time. Neat-o!  :smiley:

now i am having the same problem as Sion, HelloJMEDesktop won't react to clicking for me. I redownloded jme from CVS but still no luck, where should i start looking?

edit: ok i have HelloJMEDesktop working, but my own code still doesn't work, a little help please?

First off i am wondering what does the inputhandler for the desktop actually do? is it really needed? is that why i am having trouble with events?

here is my code that i have so far with no avail :frowning:

   public UserInterface(Node node){
      DisplaySystem display = GameWorld.getDisplay();
        input = new InputHandler();
        KeyboardLookHandler lookHandler = new KeyboardLookHandler( display.getRenderer().getCamera(), 50, 1 );
        input.addToAttachedHandlers( lookHandler );
        desktop = new JMEDesktop("JME Desktop",display.getWidth(), display.getHeight(), input);
        desktop.setLightCombineMode( LightState.OFF );
        desktop.getLocalRotation().set( 0, 0, 0, 1 );
        desktop.getLocalTranslation().set( display.getWidth() / 2, display.getHeight() / 2, 0 );
        desktop.getLocalScale().set( 1, 1, 1 );
        desktop.setRenderQueueMode( Renderer.QUEUE_ORTHO );
        desktop.setCullMode( Spatial.CULL_NEVER );
        desktopPane = desktop.getJDesktop();

      testbutton.addActionListener(new JMEAction("clickzor",UserInterface.getUI().getInput()){
         public void performAction(InputActionEvent evt) {

i see the button fine, but nothing at all happens when i click on it, please help!

Yes, the InputHandler is the crucial factor for the proper operation of JMEDesktop. Be sure to update the input handler passed to JMEDesktop and the one passed to the JMEAction (the one returned from the call UserInterface.getUI().getInput()).

If you still can't get it to work:

Does the hover effect work for the button? If yes the input handler of JMEDesktop works fine. If no the 'input' InputHandler is the problem.

Then try to add a normal swing action to the button and check that this one is invoked. If yes your 'UserInterface' InputHandler is lacking update calls.

There we go, i wasn't updating the inputhandler, thanks for the help!


ive always JUST updated from the cvs, but HelloJMEDesktop (the original one) still does not work with the problem as stated above. I thought irrisor said it was now fixed, is it something im doing wrong? please help!


Do you mean HelloJMEDesktop does not work or is it your own program?

I tested my own program (didnt work), JMEDesktop (didnt work), and TestJMEDesktop (everything worked fine in that class)

I havent changed anything in the JMEDesktop, and it is excatly the same as in the current CVS, apart from the package name (to be able to test it :slight_smile: )

what am i doing wrong? :frowning:

gilles said:

JMEDesktop (didnt work)

what do you mean here??? HelloJMEDesktop?

gilles said:

... apart from the package name (to be able to test it :) )

err, why do you need to change the package to test it?!
irrisor said:

gilles said:

JMEDesktop (didnt work)

what do you mean here??? HelloJMEDesktop?

gilles said:

... apart from the package name (to be able to test it :) )

err, why do you need to change the package to test it?!

Yes, sorry, I mean HelloJMEDesktop. And the way ive got my compiler setup, its easiest to test it if you just change the package name :) im not sure how else to do it on my machine.

Edit: how can i test a class which is in src/jmetest - the only way i thought you could do it is if it is already in the test-chooser, and if not, you had to copy it over and change the package to your own? thank you for any tips! sorry for being such a noob.

any idea why the button isnt working?  :?

im kinda desperate for this to work :( does noone know whats going on with HelloJMEDesktop?

thanks for any help

gilles, please try again with the current cvs version (I made little changes). If it still does not work please post what exactly is not working and info about your system setup (os, exact jdk version, l&f).

irrisor, HelloJMEDesktop now works, thank you :slight_smile:

there is only one small problem, which is that i need to click the mouse on the blue space around inch directly below the actual button to set off the onClick actions. The same also goes for the hover effect - if my cursor is over the button, it doesnt work, but if i put my cursor around an inch below the button, the button hover effect is triggered.

i dont know if you already knew this, or if it specific to my comp. if you need me to post details of my comp to investigate this problem, just ask and ill put some details up :slight_smile:



gilles said:

i dont know if you already knew this

It's working fine over here (with correct mouse+button locations in HelloJMEDesktop). So, no, I did not know.... it's rather strange... you didn't change anything in HelloJMEDesktop, did you?

And regarding the changed package, well, you can simply run that single test class you want to without using TestChooser or changing any package :?.