Main Scene

With the database loaded, we can now build the main UI part of our app. The Main Scene will have a search area on the top, and below we'll display the results of a search. The results will be displayed inside a ListView control, which is a scrollable list of items.

ListView displays its items as ListCell controls. ListCell is a generic type, where the generic parameter represents the item ListView is rendering. In our case, this is the DictionaryEntry type. Since we want to tell ListView how to render our DictionaryEntry type, we'll create our own DictionaryEntryCell type that extends ListCell and overrides its updateItem method. First, we'll add a new FXML file to the resources folder. dictionary_entry_cell.fxml represents the ...

Get Kotlin Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.