Java Reference
In-Depth Information
}
public ObservableList<Person> employeesProperty() {
return employees;
}
public Person(String alias, String firstName, String
lastName) {
setAliasName(alias);
setFirstName(firstName);
setLastName(lastName);
}
}
The following is the main application code. It displays a list view component on the
left containing bosses and a table view control on the right containing employees:
public void start(Stage primaryStage) {
primaryStage.setTitle("Chapter 14-13 Working with
Tables");
Group root = new Group();
Scene scene = new Scene(root, 500, 250, Color.WHITE);
// create a grid pane
GridPane gridpane = new GridPane();
gridpane.setPadding(new Insets(5));
gridpane.setHgap(10);
gridpane.setVgap(10);
// candidates label
Label candidatesLbl = new Label("Boss");
GridPane.setHalignment(candidatesLbl, HPos.CENTER);
gridpane.add(candidatesLbl, 0, 0);
// List of leaders
ObservableList<Person> leaders = getPeople();
final ListView<Person> leaderListView = new
ListView<>(leaders);
Search WWH ::




Custom Search