show hide panel in javafx using fxml


Question

I have made the GUI of my javafx application in scenebuilder. I have correctly made the settings of placing the fxml and my application works perfect. Now I want to add action events to buttons and when a button is clicked, a panel should be shown and when other button is clicked, the other panel should be shown. Please help me. And remember that I am building my interface using scenebuilder i.e using fxml for my interface.

Thank you.

1
2
12/23/2013 8:26:11 AM

you can use the following code and hide the panes you want to hide

(paneid).setVisible(false);

and appear the new code

(paneid).setVisible(True);

here the id is the what u put for "fx:id" in scenebuilder.

0
8/23/2017 6:40:05 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon