Java Reference
In-Depth Information
heroListView.getSelectionModel().clearSelection();
heroes.remove(notHero);
candidates.add(notHero);
}
});
VBox vbox = new VBox(5);
vbox.getChildren().addAll(sendRightButton,sendLeftButton);
gridpane.add(vbox, 1, 1);
GridPane.setConstraints(vbox, 1, 1, 1, 2,HPos.CENTER,
VPos.CENTER);
root.getChildren().add(gridpane);
primaryStage.setScene(scene);
primaryStage.show();
}
Figure 14-10
depicts the hero selection application.
Figure 14-10
.
ListViews and ObservableLists
How It Works
When dealing with Java
collections
you'll notice there are so many useful con-
tainer classes that represent all kinds of data structures. One commonly used collection