Short question is how do I get multiple buttons to go to the same sub routine?
This should have a simple solution but I can't figure it out for B4J. I have this working in Android but the same logic isn't working in B4J. I have 30 buttons that I want to change the Button.Text dynamically for, but I want to do the text change in one sub routine via the array. I am saving the buttons in an array to do this. I am not creating the buttons with code. I'm using Scene Builder.
If I give each button its own unique Java FX CSS Id (Node ID?) everything works fine but I have to create a separate sub routine for each button. If I give them all the same Id it doesn't work. How can I give each button its own Id but have them all go to the same sub routine when it is clicked?
Editing to add more info:
I see areas in the Scene Builder called "On Action" and "On Mouse Click" under the fx:id but can't find any doc to explain these. Will these give me what I want?
This should have a simple solution but I can't figure it out for B4J. I have this working in Android but the same logic isn't working in B4J. I have 30 buttons that I want to change the Button.Text dynamically for, but I want to do the text change in one sub routine via the array. I am saving the buttons in an array to do this. I am not creating the buttons with code. I'm using Scene Builder.
If I give each button its own unique Java FX CSS Id (Node ID?) everything works fine but I have to create a separate sub routine for each button. If I give them all the same Id it doesn't work. How can I give each button its own Id but have them all go to the same sub routine when it is clicked?
Editing to add more info:
I see areas in the Scene Builder called "On Action" and "On Mouse Click" under the fx:id but can't find any doc to explain these. Will these give me what I want?
Last edited: