Edit integer and float outputs from the toolbar

Hello everybody, I found this URCap example in Java that creates a toolbar that displays Boolean, integer, and float input and output values in the polyscope. I would like to implement this code so that when I click on the integer or float output label a textbox appears and I can change the output value. Does anyone have any ideas on how I can do this?