I am working on a project where I have ComboBox in a pane, which has "Games", "Albums", and "Movies".
I want to open another Pane when one of these is selected.
How can I do that?
Here is my code:
GridPane select = new GridPane();
select.setAlignment(Pos.CENTER);
select.setHgap(6.5);
select.setVgap(6.5);
select.add(new Label("Media Type"), 0, 1)
ComboBox comboBox = new ComboBox();
comboBox.getItems().add("Movies");
comboBox.getItems().add("Albums");
comboBox.getItems().add("Games");
HBox hbox = new HBox(comboBox);
Scene thirdScene = new Scene(hbox, 500, 500);
Stage thirdStage = new Stage();
thirdStage.setScene(thirdScene);
thirdStage.setTitle("Media Menu");
thirdStage.show();
![Set action when an item from combobox is selected [closed]](https://file.115kc.com/storage/eg/image372.jpg)