title: JavaFX synchronizing two choiceboxes
body: <p>So I'm trying to learn java and tried to program my first App. It's supposed to a Converter but I'm running in a little problem. I want to synchronize two chioceboxes so that when I select for example length in the first one I can't select gram in the second one and so on. 
  But I don't know how to do this I tried to use to ChangeListner but I don't really understand what I'm doing ;).
  It's problaby not the code but I hope you can understand theproblem I'm having right now.</p>
  
  <pre><code>@Override
  public void start(Stage primaryStage) throws Exception {
  
      //Labels
      Label title = new Label("Converter");
      title.setFont(new Font("Cambria", 28));
  
      Label choice1Label = new Label("Please enter a value");
  
      Label scene1choice1 = new Label("Please enter your first value:");
      Label scene1choice2 = new Label("Please enter your second value:");
  
      // Buttons
      Button btnHome = new Button("Next");
  
  
      //ChoiceBoxen
      ChoiceBox homeValue = new ChoiceBox();
      homeValue.setValue("length");
      homeValue.setItems(FXCollections.observableArrayList("length", "area", "volume", "weigth"));
  
      ChoiceBox value1 = new ChoiceBox();
  
  
  
      //V- and HBoxen
      HBox titleBox = new HBox(title);
      titleBox.setAlignment(Pos.TOP_CENTER);
      titleBox.setPadding(new Insets(30));
      titleBox.setSpacing(40);
  
      HBox fstChoiceLabel = new HBox(choice1Label);
      fstChoiceLabel.setAlignment(Pos.CENTER);
      fstChoiceLabel.setPadding(new Insets(75));
      fstChoiceLabel.setSpacing(70);
  
      HBox frstchoice = new HBox(homeValue);
      frstchoice.setAlignment(Pos.CENTER);
      frstchoice.setPadding(new Insets(40));
      frstchoice.setSpacing(70);
  
      HBox fstBtn_Home = new HBox(btnHome);
      fstBtn_Home.setAlignment(Pos.BOTTOM_CENTER);
      fstBtn_Home.setPadding(new Insets(40));
      fstBtn_Home.setSpacing(20);
  
      VBox homeScreen = new VBox(fstChoiceLabel, frstchoice);
  
      HBox scene1Label1 = new HBox(scene1choice1);
      scene1Label1.setAlignment(Pos.CENTER);
      scene1Label1.setPadding(new Insets(10));
      scene1Label1.setSpacing(20);
  
      HBox scene1Choice1 = new HBox(value1);
      scene1Choice1.setAlignment(Pos.CENTER);
      scene1Choice1.setPadding(new Insets(10));
      scene1Choice1.setSpacing(20);
  
  
      HBox scene1Label2 = new HBox(value1);
      scene1Label2.setAlignment(Pos.CENTER);
      scene1Label2.setPadding(new Insets(10));
      scene1Label2.setSpacing(20);
  
      HBox scene1Choice2 = new HBox();
      scene1Choice2.setAlignment(Pos.CENTER);
      scene1Choice2.setPadding(new Insets(10));
      scene1Choice2.setSpacing(20);
  
      VBox scene1Label = new VBox(scene1Label1, scene1choice1, scene1Label2, scene1choice2);
  
  
      //Scene
      BorderPane pane = new BorderPane();
      pane.setTop(titleBox);
      pane.setCenter(homeScreen);
      pane.setBottom(fstBtn_Home);
  
      BorderPane pane1 = new BorderPane();
      pane1.setCenter(scene1Label);
  
      BorderPane pane2 = new BorderPane();
  
      Scene scene = new Scene(pane, 300, 500);
      Scene scene1 = new Scene(pane1, 300, 500);
      Scene scene2 = new Scene(pane2, 300, 500);
  
      btnHome.setOnAction(e -&gt; window.setScene(scene1));
  
  
      //Window
      primaryStage.setTitle("UMRECHNER");
      primaryStage.setScene(scene);
      primaryStage.show();
  
  }
  </code></pre>