package test.scenegraph.app; import javafx.application.Application; import javafx.beans.property.StringProperty; 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.TextBox; import javafx.scene.layout.Pane; import javafx.stage.Stage; public class ShortAppWithoutDependencies5111 extends Application { public class Person { private StringProperty firstName = new StringProperty(); private StringProperty lastName = new StringProperty(); public Person(String _a, String _b) { setFirstName(_a); setLastName(_b); } public final void setFirstName(String value) { firstName.set(value); } public String getFirstName() { return firstName.get(); } public StringProperty firstNameProperty() { if (firstName == null) firstName = new StringProperty(); return firstName; } public final void setLastName(String value) { lastName.set(value); } public String getLastName() { return lastName.get(); } public StringProperty lastNameProperty() { if (lastName == null) lastName = new StringProperty(); return lastName; } } @Override public void start(Stage stage) { Pane h = new Pane(); Scene scene = new Scene(h); stage.setScene(scene); stage.setWidth(500); stage.setHeight(500); TableView table = new TableView(); h.getChildren().add(new TextBox()); h.getChildren().add(table); table.setTranslateX(200); ObservableList teamMembers = FXCollections.observableArrayList(); teamMembers.add(new Person("a","b")); table.setItems(teamMembers); TableColumn firstNameCol = new TableColumn(""); firstNameCol.setProperty("firstName"); TableColumn lastNameCol = new TableColumn(""); lastNameCol.setProperty("lastName"); table.getColumns().setAll(firstNameCol, lastNameCol); table.setMaxHeight(100); //table.setPrefHeight(100); stage.setVisible(true); } public static void main(String args[]) { Application.launch(ShortAppWithoutDependencies5111.class, args); } }