I am a beginner in JavaFX. I am really stuck at this point. And sorry if my English is poor.
I have two stack panes in my JavaFX program. I want to add a focus listener to both of these stack panes.
It should be such that, when I click on one stack pane, it should activate the focus gained method for this stack pane.
Once I click on another stack pane, the 1st stack pane should give a call to its focus lost method, and the current stack pane's focus gained method should be called. Just like we have focus events in the Swing Package.
Currently I have tried this:
I have also tried to set the focus traversable property on the stack pane i.e.
These are not working properly. When I run it, the output only shows these 3 lines, no matter how many times I click on the stack panes.
posted 3 years ago
Too difficult a question for “beginnning”. Moving to our FX forum.