How to add a mouse doubleclick event listener to the cells of a ListView in javafx? - Stack Overflow

PHOTO EMBED

Thu Dec 03 2020 16:35:03 GMT+0000 (Coordinated Universal Time)

Saved by @jasoncriss

playList.setOnMouseClicked(new EventHandler<MouseEvent>() {

    @Override
    public void handle(MouseEvent click) {

        if (click.getClickCount() == 2) {
           //Use ListView's getSelected Item
           currentItemSelected = playList.getSelectionModel()
                                                    .getSelectedItem();
           //use this to do whatever you want to. Open Link etc.
        }
    }
});
content_copyCOPY

can also use % 2 == 0

https://stackoverflow.com/questions/22542015/how-to-add-a-mouse-doubleclick-event-listener-to-the-cells-of-a-listview-in-java