I use three buttons to display each child panel in stackpane,but when I click the button,it displays different panels per click
Example
btn0-> pane 0,pane 1and pane 2
btn1-> pane 0,pane 1and pane 2
btn2-> pane 0,pane 1and pane 2
I just want it to display a specific panel for specific buttons in java swing cardLayout should I do?
btn0-> pane 0
btn1-> pane 1
btn2-> pane 2
Please help me!
@FXML
void btn0(ActionEvent event) {
stackConsole.getChildren().get(0).toFront();
}
@FXML
void btn1(ActionEvent event) {
stackConsole.getChildren().get(1).toFront();
}
@FXML
void btn2(ActionEvent event) {
stackConsole.getChildren().get(2).toFront();
}