February 2014
Beginner
1248 pages
62h 25m
English
As you saw in Section 26.6, ListView cells display the String representations of a ListView’s items by default. To create a custom cell format, you must first define a subclass of the ListCell generic class (package javafx.scene.control) that specifies how to create a ListView cell. As the ListView displays items, it gets ListView cells from its cell factory. You’ll use the ListView’s setCellFactory method to replace the default cell factory with one that returns objects of the ListCell subclass. You’ll override this class’s updateItem method to specify the cells’ custom layout and contents.
Read now
Unlock full access