📜  在选定的项目上更改了 listview javafx - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:03.489000             🧑  作者: Mango

代码示例1
myListView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {

    @Override
    public void changed(ObservableValue observable, MyDataModel oldValue, MyDataModel newValue) {
        // Your action here
        System.out.println("Selected item: " + newValue);
    }
});