O'Reilly logo

Java 9: Building Robust Modular Applications by Jason Lee, Peter Verhas, Dr. Edward Lavieri

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining user interface behavior

While we can define the structure of the user interface in FXML in all but the most trivial applications, the user interface still requires some Java code to finish defining its behavior. We'll do that now in DeskDroidController.initialize(). We'll start with the left side of the user interface, the conversation list, as follows:

 @FXML private ListView<Conversation> convList; private final ObservableList<Conversation> conversations = FXCollections.observableArrayList(); private final SimpleObjectProperty<Conversation> conversation = new SimpleObjectProperty<>(); @Override public void initialize(URL url, ResourceBundle rb) { convList.setCellFactory(list -> new ConversationCell(convList)); convList.setItems(conversations); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required