package controls; import com.sun.javafx.collections.ObservableListWrapper; import com.sun.javafx.runtime.VersionInfo; import java.util.Arrays; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.ListView; import javafx.stage.Stage; public class DoListView extends Application { @Override public void start(Stage stage) { stage.setTitle(VersionInfo.getRuntimeVersion()); ListView list = new ListView(); ObservableListWrapper items = new ObservableListWrapper(Arrays.asList("One", "Two", "Three", "Four", "Five", "Six", "long line long line long line long line")); list.setItems(items); list.setPrefWidth(100); list.setPrefHeight(100); list.setFocusTraversable(false); list.setStyle("-fx-border-color:red;"); stage.setScene(new Scene(new Group(list), 300, 300)); stage.show(); } public static void main(String[] args) { launch(DoListView.class, args); } }