javafx choicebox events

Add a ChangeListener to the ChoiceBox's selectionmodel and selectedIndexProperty:

final ChoiceBox<String> box = new ChoiceBox<String>();

    box.getItems().add("1");
    box.getItems().add("2");
    box.getItems().add("3");

    box.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
      @Override
      public void changed(ObservableValue<? extends Number> observableValue, Number number, Number number2) {
        System.out.println(box.getItems().get((Integer) number2));
      }
    });

Sebastian explained well enough though, just incase if you have interest only on actual value selected on the choice box and doesn't much care about index, then you can just use selectedItemProperty instead of selectedIndexProperty.

Also ChangeListener is functional interface, you can use lambda here when you go with java 8. I just little bit modified Sebastian's example. The newValue is newly selected value.

ChoiceBox<String> box = new ChoiceBox<String>();
box.getItems().add("1");
box.getItems().add("2");
box.getItems().add("3");

box.getSelectionModel()
    .selectedItemProperty()
    .addListener( (ObservableValue<? extends String> observable, String oldValue, String newValue) -> System.out.println(newValue) );