Trying to use 2 combo boxes

I have to create a program which uses two combo boxes. I have tried multiple times/multiple different ways to create both combo boxes, but the GUI freezes up the moment I go to expand the contents of the second combo box. I have tried just about everything I know how as far as trying different panes, etc. Is there something I am missing here? I do not know jframe so a solution using that won't work. Any help is greatly appreciated!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class Exercise extends Application {
    
    @Override 
    public void start(Stage primaryStage) {
        
        ComboBox<String> cbYear = new ComboBox<>();
        ComboBox<String> cbGender = new ComboBox<>();
        
        cbYear.getItems().addAll("2001", "2002", "2003", "2004",
                "2005", "2006", "2007", "2008", "2009", "2010");
        cbGender.getItems().addAll("Male", "Female");
        
        cbYear.setValue("2001");
        cbGender.setValue("Male");
        
        VBox vbColumn1 = new VBox();
        vbColumn1.getChildren().addAll(cbYear, cbGender);
        
        Scene scene = new Scene(vbColumn1);
        
        primaryStage.setTitle("Exercise"); // Set the stage title
        primaryStage.setScene(scene); // Place the scene in the stage
        primaryStage.show(); // Display the stage

    }
    
    public static void main(String[] args) {
        launch(args);
    }
}
Wow....I am really sorry haha. Too much studying today.....mods please delete
Topic archived. No new replies allowed.