/* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. */ package fxtest; import com.sun.javafx.css.CSSEvent; import com.sun.javafx.css.CSSListener; import com.sun.javafx.css.StyleManager; import javafx.application.Application; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.geometry.Orientation; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.ListView; import javafx.scene.control.TextArea; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class Main extends Application { /** * @param args the command line arguments */ public static void main(String[] args) { Application.launch(args); } private static ObservableList data = FXCollections.observableArrayList(); static { data.addAll("Row 1", "Row 2", "Row 3", "Row 4"); } @Override public void start(Stage stage) { VBox root = new VBox(10); Scene scene = new Scene(root, 800, 600); TextArea textArea = new TextArea(); textArea.setPrefColumnCount(24); root.getChildren().add(textArea); textArea.setText("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n"); ListView listView = new ListView(); listView.setOrientation(Orientation.HORIZONTAL); listView.setItems(data); root.getChildren().add(listView); stage.setScene(scene); stage.show(); } }