package javaapplication35; import javafx.application.Application; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.scene.Scene; import javafx.scene.control.ListView; import javafx.scene.control.SelectionMode; import javafx.stage.Stage; public class JavaApplication35 extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { ListView lv = new ListView(); lv.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); for (int i = 0; i < 100; i++) { lv.getItems().add(0); } lv.getFocusModel().focusedIndexProperty().addListener(new ChangeListener() { @Override public void changed(ObservableValue ov, Number t, Number t1) { System.out.println("Focus : " + t1); } }); stage.setScene(new Scene(lv, 100, 100)); stage.show(); } }