[10:7] extends: Node, Control, Region
Represents a JavaFX ListView, a control for displaying a list of items. The ListView class allows for item selection, change listeners, and retrieval of the selected item.
ListView (Items = null
)
Initializes a new ListView instance with optional items. If an item list is provided, it is set as the initial content of the ListView.
Items
An array of items to populate the ListView, or null for an empty list.this
objectonChange (callback OnChange
)
Sets a callback function that triggers when the selected item changes.
OnChange
The callback function to execute on item selection change.this
object for chaininggetSelected ()
Retrieves the currently selected item in the ListView.
The
selected item object, or null if no item is selected.getSelectionModel ()
Internal method to get the selection model for the ListView.
The
selection model for managing item selection.