diff --git a/simpleexample2/fxui/src/main/java/simpleex/ui/AbstractFxAppController.java b/simpleexample2/fxui/src/main/java/simpleex/ui/AbstractFxAppController.java index 6cd28996b148f720f2d55bce58c2e45e57d2122a..dd64168c4480e8d1db1804866bd121e65c7a562c 100644 --- a/simpleexample2/fxui/src/main/java/simpleex/ui/AbstractFxAppController.java +++ b/simpleexample2/fxui/src/main/java/simpleex/ui/AbstractFxAppController.java @@ -12,7 +12,9 @@ import javafx.geometry.Point2D; import javafx.scene.Node; import javafx.scene.control.Alert; import javafx.scene.control.Alert.AlertType; +import javafx.util.Callback; import javafx.scene.control.ButtonType; +import javafx.scene.control.ListCell; import javafx.scene.control.ListView; import javafx.scene.control.Slider; import simpleex.core.LatLong; @@ -84,6 +86,13 @@ public abstract class AbstractFxAppController { // the location list locationListView.getSelectionModel().selectedIndexProperty() .addListener((prop, oldValue, newValue) -> updateMapMarker(true)); + //connect the cell renderer to the list + locationListView.setCellFactory(new Callback<ListView<LatLong>, ListCell<LatLong>>() { + @Override + public ListCell<LatLong> call(ListView<LatLong> listView) { + return new LatLongCell(); + } + }); } private void handleMapDragged(final Node node, final double dx, final double dy) { @@ -157,6 +166,7 @@ public abstract class AbstractFxAppController { if (selectedIndex >= 0 && selectedIndex < latLongs.length) { locationListView.getSelectionModel().select(selectedIndex); } + } private ObjectMapper objectMapper;