Skip to Content
Java 9: Building Robust Modular Applications
book

Java 9: Building Robust Modular Applications

by Dr. Edward Lavieri, Peter Verhas, Jason Lee
April 2018
Intermediate to advanced content levelIntermediate to advanced
910 pages
33h 21m
English
Packt Publishing
Content preview from Java 9: Building Robust Modular Applications

Authorizing the client

Up until this point, everything has assumed that the desktop is already connected to the phone. We have enough pieces in place now that we can talk about that in a meaningful manner.

In the application's main Menu, we have two MenuItems: Connect to Phone and Disconnect from Phone. The Connect to Phone handler looks as follows:

    @FXML 
    protected void connectToPhone(ActionEvent event) { 
      ConnectToPhoneController.showAndWait(); 
      if (!preferences.getToken().isEmpty()) { 
        refreshAndListen(); 
      } 
    } 

We're going to use the now-familiar showAndWait() pattern to display a modal dialog, and to get the response using the new ConnectToPhoneController. The user interface is very simple, and is shown in this screenshot:

When the user ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java 9 High Performance

Java 9 High Performance

Mayur Ramgir, Nick Samoylov
Distributed Computing in Java 9

Distributed Computing in Java 9

Raja Malleswara Rao Malleswara Rao Pattamsetti

Publisher Resources

ISBN: 9781788832823Supplemental ContentOtherPurchase LinkErrata Page