You are previewing JavaFX Essentials.
O'Reilly logo
JavaFX Essentials

Book Description

Create amazing Java GUI applications with this hands-on, fast-paced guide

In Detail

JavaFX is a software platform to create and deliver rich Internet applications (RIAs) that can run across a wide variety of devices.

JavaFX Essentials will help you to design and build high performance JavaFX 8-based applications that run on a variety of devices.

Starting with the basics of the framework, it will take you all the way through creating your first working application to discovering the core and main JavaFX 8 features, then controlling and monitoring your outside world. The examples provided illustrate different JavaFX and Java SE 8 features.

This guide is an invaluable tutorial if you are planning to develop and create JavaFX 8 applications to run on a variety of devices and platforms.

What You Will Learn

  • Deliver complex, compelling, and high performance JavaFX 8 applications with new impressive Java SE 8 core features and enhancements

  • Run JavaFX applications on embedded devices such as Raspberry Pi

  • Use Scene Builder to create and define UI screens graphically and save them as JavaFX FXML-formatted files

  • Develop amazing gesture-based applications and an interactive touchless JavaFX application with Leap motion devices

  • Get hands-on knowledge about mobile development and create native JavaFX applications for Apple iOS and Android platforms

  • Use JavaFX with an Arduino board to develop desktop applications to monitor data coming from the real world or control real devices

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.

    Table of Contents

    1. JavaFX Essentials
      1. Table of Contents
      2. JavaFX Essentials
      3. Credits
      4. About the Author
      5. About the Reviewers
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Getting Started with JavaFX 8
        1. JavaFX goals
        2. Getting started
        3. JavaFX history
          1. When is JavaFX 8 available?
        4. JavaFX features
          1. What's new in JavaFX 8
        5. Installing the required software
          1. Installing Java SE 8 JDK
            1. Setting environment variables
          2. Installing the NetBeans IDE
        6. Creating "Hello World" JavaFX-style applications
          1. Using the Netbeans IDE
          2. How it works
        7. Summary
      9. 2. JavaFX 8 Essentials and Creating a Custom UI
        1. Quick review of the JavaFX 8 architecture
          1. Scene graphs
          2. Java public APIs for JavaFX features
          3. Graphics System
          4. Glass Windowing Toolkit
          5. JavaFX threads
          6. Media and images
          7. Web component
          8. Layout components
          9. JavaFX controls
        2. Java SE 8 features
          1. Lambda expressions
            1. Syntax
          2. Functional interfaces
        3. Theming
          1. CSS
            1. Applying CSS theme
        4. Scene Builder
          1. Downloading and launching
          2. FXML
            1. Loading FXML into JavaFX applications
        5. Developing a custom UI
          1. The Login dialog custom UI
            1. Structure of the Login dialog custom UI
            2. Coding the Login dialog custom UI
        6. Summary
      10. 3. Developing a JavaFX Desktop and Web Application
        1. Developing a note-taking application
          1. Building the UI prototype
          2. Bringing your application to life – adding interactions
            1. Power application change synchronization with properties
              1. Filtering the TableView data list
          3. Note-taking as a desktop application
            1. Deploying the application for desktop distribution
        2. JavaFX on the Web
          1. WebEngine
          2. WebView
            1. WebView and engine in action
          3. Note-taking as a web application
            1. Running the application for the Web
              1. Java Web Start
            2. Deploying the application for a web distribution
        3. Summary
      11. 4. Developing a JavaFX Application for Android
        1. Why port JavaFX into the mobile environment?
          1. How it works
          2. Who is maintaining it?
        2. Getting started
          1. Preparing and installing the prerequisite software
            1. Java SE 8 JDK8 u45
            2. Gradle
            3. Android SDK
          2. Preparing the project for Android
            1. Project structure
              1. Using Gradle
          3. The application
            1. Developing and styling an application UI with CSS
            2. Adding some logic
            3. Making your project ready for mobile devices
              1. Interoperability with low-level Android APIs
          4. Building the application
            1. Building the final .apk Android package
          5. Deploying the application
            1. Deploying on Android-based devices
            2. Deploying on the Google Play Store
              1. Signing the APK
          6. Testing tips
        3. Summary
      12. 5. Developing a JavaFX Application for iOS
        1. Using RoboVM to run JavaFX on iOS
          1. Features
          2. Limitations
          3. How it works
        2. Getting started
          1. Prerequisites
          2. Preparing a project for iOS
            1. Project structure
            2. The application
              1. Interoperability with low-level iOS APIs
            3. Gradle build files
              1. Building the application
              2. Generating the iOS .ipa package file
            4. Deploying the application
              1. Deploying to a simulator
              2. Deploying to an Apple device
        3. Summary
      13. 6. Running JavaFX Applications on the Raspberry Pi
        1. What is the Raspberry Pi?
          1. What can you do with it?
        2. Why is the Raspberry Pi a perfect fit for JavaFX?
        3. Which module should you buy?
          1. Buying the Raspberry Pi
          2. Related websites and documentation
        4. Preparing the Raspberry Pi for JavaFX 8
          1. Creating a bootable SD card
            1. Using NOOBS
          2. Configuring the Raspberry Pi
          3. Connecting to the Raspberry Pi remotely
            1. Installing VNC on the Raspberry Pi
              1. Setting up VNC to start at boot
            2. Setting up a static IP address
            3. Auto login in the Raspberry Pi
            4. Connecting to VNC with a client
        5. JavaFX 8 development prerequisites
          1. Installing Java SE 8 on the Raspberry Pi
          2. Installing Java SE 8
          3. Adding JavaFX
          4. Configuring NetBeans for the Raspberry Pi
        6. The switch application
          1. What is the Pi4J library?
            1. Circuit setup
          2. The application
        7. Using NetBeans with the Pi
        8. Summary
      14. 7. Monitoring and Controlling Arduino with JavaFX
        1. What is an Arduino board?
          1. What can you do with it?
            1. Related websites and documentation
          2. Setting up your Arduino
            1. Buying an Arduino
            2. Other components you will need
            3. The Arduino IDE
              1. Downloading the IDE
              2. Installing the drivers
                1. Windows Setup
                2. Mac OS X and Linux setup
              3. Exploring the IDE and sketches
          3. The blood meter project
            1. Tinkering with the circuit
              1. The sketch
              2. How it works
              3. Testing, verifying, and uploading the sketch into the Arduino
            2. Reading data from serial ports
            3. The JavaFX blood meter monitoring application
              1. Serial communication in Java
              2. Application logic and charting API
              3. Running the application
        2. Summary
      15. 8. Interactive Leap Motion Apps with JavaFX
        1. The Leap Motion controller
          1. How it works
            1. The coordinate system
          2. Getting the device
            1. Package contents
          3. Getting started with the Leap SDK
            1. Installing the controller driver and software
              1. Verifying whether it works
          4. Supported languages
        2. The Leap JavaFX application
          1. The JavaFX 3D API at a glance
          2. More learning resources
          3. The basic application structure
            1. The JavaFX 8 3D application
            2. How it works
            3. Running the application
        3. More examples
        4. Summary
      16. A. Become a JavaFX Guru
        1. Resources and references
          1. Official documentation
          2. JavaFX samples
          3. Java SE 8
            1. The Java SE 8 API documentation and tutorials
            2. Project Lambda
            3. Nashorn
          4. JavaFX properties and bindings
          5. JavaFX communities
          6. Java SE / JavaFX books and magazines
      17. Index