Update shown elements on click

hi again, back with another question :slight_smile:

at the moment ißm trying to get this to work:

two buttons that add or delete objects and a display that shows the number of that objects in the current scene.

the number has its origin in a double or an int from the main class.

so when i click on add for example, that value changes in the programm, but not on the display.

how can that be done (not the buttons, thats working, but the update of numbers)?

i played with some of the code of the nifty progressbars text stuff a bit, but wasnt successfull at all.

i bet that one was already done and solved, but i havent found it here.

any ideas? thanks

no ideas, anyone?

If nobody answers try the documentation for a change:

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:nifty_gui_java_interaction#java_modifies_nifty_elements_and_events

thank you normen, i tried that a few days before, but didnt get it to work.



this time i got it right and finally it works :slight_smile:

i thought that this solution wouldnt work for me, but it did.



and yes, i read all of the stuff from the wiki, but that doesnt always mean that i understand it :wink: