package bugreport; import javafx.application.Application; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.Scene; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.cell.PropertyValueFactory; import javafx.scene.layout.BorderPane; import javafx.stage.Stage; public class SimpleTableApp extends Application { private TableView tableView = new TableView(); private ObservableList dataList; public static void main(String[] args) { launch(args); } @Override public void start(Stage pStage) { // Data dataList = FXCollections.observableArrayList(); for (int i = 1; i <= 100; i++) { dataList.add(new Record("Record: " + i, i)); } TableColumn tcolText = new TableColumn("Text"); tcolText.setCellValueFactory(new PropertyValueFactory("text")); TableColumn tcolValue = new TableColumn("Value"); tcolValue.setCellValueFactory(new PropertyValueFactory("value")); tableView.setItems(dataList); tableView.getColumns().addAll(tcolText, tcolValue); // Layout BorderPane bpane = new BorderPane(); bpane.setCenter(tableView); pStage.setTitle("Simple TableView"); pStage.setScene(new Scene(bpane, 300, 400)); pStage.show(); } public class Record { private String sText; private double dValue; public Record(String pText, double pValue) { sText = pText; dValue = pValue; } public String getText() { return sText; } public double getValue() { return dValue; } } }