List of usage examples for javafx.scene.layout StackPane StackPane
public StackPane()
From source file:Main.java
@Override public void start(Stage primaryStage) { CategoryAxis xAxis = new CategoryAxis(); NumberAxis yAxis = new NumberAxis(); BarChart barChart = new BarChart(xAxis, yAxis, getChartData(), 0.2); barChart.setTitle("A"); primaryStage.setTitle("BarChart example"); StackPane root = new StackPane(); root.getChildren().add(barChart);/* w ww .ja v a2 s . c o m*/ primaryStage.setScene(new Scene(root, 400, 250)); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { CategoryAxis xAxis = new CategoryAxis(); NumberAxis yAxis = new NumberAxis(); BarChart barChart = new BarChart(xAxis, yAxis, getChartData()); barChart.setBarGap(0.2);//from ww w . j av a 2s.c om barChart.setTitle("A"); primaryStage.setTitle("BarChart example"); StackPane root = new StackPane(); root.getChildren().add(barChart); primaryStage.setScene(new Scene(root, 400, 250)); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { CategoryAxis xAxis = new CategoryAxis(); NumberAxis yAxis = new NumberAxis(); BarChart barChart = new BarChart(xAxis, yAxis, getChartData()); barChart.setCategoryGap(0.2);// w w w.ja va 2 s . c o m barChart.setTitle("A"); primaryStage.setTitle("BarChart example"); StackPane root = new StackPane(); root.getChildren().add(barChart); primaryStage.setScene(new Scene(root, 400, 250)); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { CategoryAxis xAxis = new CategoryAxis(); NumberAxis yAxis = new NumberAxis(); LineChart lineChart = new LineChart(xAxis, yAxis); lineChart.setData(getChartData());/*w w w. j a v a 2s. c o m*/ lineChart.setTitle("Chart"); primaryStage.setTitle("LineChart example"); StackPane root = new StackPane(); root.getChildren().add(lineChart); primaryStage.setScene(new Scene(root, 400, 250)); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { TableView table = new TableView(); table.setEditable(true);/* w w w . j a va 2 s . c o m*/ TableColumn firstNameCol = new TableColumn("First Name"); TableColumn lastNameCol = new TableColumn("Last Name"); TableColumn addressCol = new TableColumn("Email"); table.getColumns().addAll(firstNameCol, lastNameCol, addressCol); TableColumn cityCol = new TableColumn("City"); TableColumn stateCol = new TableColumn("State"); addressCol.getColumns().addAll(cityCol, stateCol); StackPane root = new StackPane(); root.getChildren().add(table); primaryStage.setScene(new Scene(root, 200, 250)); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { ObservableList<String> data = FXCollections.observableArrayList(); ListView<String> listView = new ListView<String>(data); listView.setPrefSize(200, 250);//from w w w .jav a 2 s. c o m listView.setEditable(true); data.addAll("A", "B", "C", "D", "E"); listView.setItems(data); listView.setCellFactory((ListView<String> l) -> new ColorRectCell()); StackPane root = new StackPane(); root.getChildren().add(listView); primaryStage.setScene(new Scene(root, 200, 250)); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { NumberAxis xAxis = new NumberAxis(); NumberAxis yAxis = new NumberAxis(); xAxis.setAutoRanging(false);//from ww w . j a va 2s.co m xAxis.setLowerBound(2011); xAxis.setUpperBound(2016); BubbleChart bubbleChart = new BubbleChart(xAxis, yAxis, getChartData()); bubbleChart.setTitle("Title"); primaryStage.setTitle("Chart example"); StackPane root = new StackPane(); root.getChildren().add(bubbleChart); primaryStage.setScene(new Scene(root, 400, 250)); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { NumberAxis xAxis = new NumberAxis(); NumberAxis yAxis = new NumberAxis(); xAxis.setAutoRanging(false);//w ww. jav a2s . co m xAxis.setLowerBound(2011); xAxis.setUpperBound(2016); BubbleChart bubbleChart = new BubbleChart(xAxis, yAxis); bubbleChart.setData(getChartData()); bubbleChart.setTitle("Title"); primaryStage.setTitle("Chart example"); StackPane root = new StackPane(); root.getChildren().add(bubbleChart); primaryStage.setScene(new Scene(root, 400, 250)); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { ObservableList<String> data = FXCollections.observableArrayList(); ListView<String> listView = new ListView<String>(data); listView.setPrefSize(200, 250);/*from w ww .j av a2 s .c om*/ data.addAll("A", "B", "C", "D", "E"); listView.setItems(data); listView.getSelectionModel().selectedItemProperty() .addListener((ObservableValue<? extends String> ov, String old_val, String new_val) -> { System.out.println(new_val); }); StackPane root = new StackPane(); root.getChildren().add(listView); primaryStage.setScene(new Scene(root, 200, 250)); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { ObservableList<String> names = FXCollections.observableArrayList(); ObservableList<String> data = FXCollections.observableArrayList(); ListView<String> listView = new ListView<String>(data); listView.setPrefSize(200, 250);//from ww w .j a v a 2s . c om listView.setEditable(true); names.addAll("A", "B", "C", "D", "E"); data.add("Double Click to Select Value"); listView.setItems(data); listView.setCellFactory(ComboBoxListCell.forListView(names)); StackPane root = new StackPane(); root.getChildren().add(listView); primaryStage.setScene(new Scene(root, 200, 250)); primaryStage.show(); }