Pro JavaFX 8

Book description

In Pro JavaFX 8 expert authors show you how to use the JavaFX platform to create rich-client Java applications. You'll discover how you can use this powerful Java-based UI platform, which is capable of handling large-scale data-driven business applications for PC as well as now mobile and embedded devices.

Covering the JavaFX API, development tools, and best practices, this book provides code examples that explore the exciting new features provided with JavaFX 8 which comes as part of Oracle's new Java (SE) 8 release. This book also contains engaging tutorials that cover virtually every facet of JavaFX development and reference materials on JavaFX that augment the JavaFX API documentation.

  • After reading and using this book, you'll have the authoritative knowledge that should give you an edge in your next JavaFX-based application projects for your job or your clients.
  • Table of contents

    1. Cover
    2. Title
    3. Copyright
    4. Contents at a Glance
    5. Contents
    6. About the Authors
    7. About the Technical Reviewer
    8. Acknowledgments
    9. Foreword
    10. Introduction
    11. Chapter 1: Getting a Jump Start in JavaFX
      1. A Brief History of JavaFX
      2. Prepare Your JavaFX Journey
        1. Required Tools
        2. JavaFX, the Community
        3. Use the Official Specifications
        4. ScenicView
      3. Developing Your First JavaFX Program: Hello Earthrise
        1. Compiling and Running from the Command Line
        2. Understanding the Hello Earthrise Program
        3. Building and Running the Program with NetBeans
      4. Developing Your Second JavaFX Program: “More Cowbell!”
        1. Building and Running the Audio Configuration Program
        2. The Behavior of the Audio Configuration Program
        3. Understanding the Audio Configuration Program
        4. Colors and Gradients
        5. The Model Class for the Audio Configuration Example
        6. Using InvalidationListeners and Lambda Expressions
      5. Surveying JavaFX Features
      6. Summary
      7. Resources
    12. Chapter 2: Creating a User Interface in JavaFX
      1. Programmatic Versus Declarative Creation of the User Interface
      2. Introduction to Node-Centric UIs
      3. Setting the Stage
        1. Understanding the Stage Class
        2. Using the Stage Class: The StageCoach Example
        3. Understanding the StageCoach Program
      4. Making a Scene
        1. Using the Scene Class: The OnTheScene Example
        2. Understanding the OnTheScene Program
      5. Handling Input Events
        1. Surveying Mouse, Keyboard, Touch, and Gesture Events and Handlers
        2. Understanding the KeyEvent Class
        3. Understanding the MouseEvent Class
        4. Understanding the TouchEvent Class
        5. Understanding the GestureEvent Class
      6. Animating Nodes in the Scene
        1. Using a Timeline for Animation
        2. Using the Transition Classes for Animation
        3. The Zen of Node Collision Detection
      7. Summary
      8. Resources
    13. Chapter 3: Using SceneBuilder to Create a User Interface
      1. Setting the Stage with FXML
        1. Creating a User Interface Graphically with JavaFX SceneBuilder
        2. Understanding the FXML File
        3. Understanding the Controller
        4. Understanding the FXMLLoader
      2. Understanding the FXML Loading Facility
        1. Understanding the FXMLLoader Class
        2. Understanding the @FXML Annotation
      3. Exploring the Capabilities of FXML Files
        1. The Deserialization Power of the FXML Format
        2. Understanding Default and Static Properties
        3. Understanding Attribute Resolutions and Bindings
        4. Using Multiple FXML Files
        5. Creating Custom Components Using fx:root
        6. Event Handling Using Scripting or Controller Properties
      4. Using JavaFX SceneBuilder
        1. Overview of JavaFX SceneBuilder
        2. Understanding the Menu Bar and Items
        3. Understanding the Library Panel
        4. Understanding the Document Panel
        5. Understanding the Content Panel
        6. Understanding the Inspector Panel
      5. Summary
      6. Resources
    14. Chapter 4: Properties and Bindings
      1. Forerunners of JavaFX Binding
      2. A Motivating Example
      3. Understanding Key Interfaces and Concepts
        1. Understanding the Observable Interface
        2. Understanding the ObservableValue Interface
        3. Understanding the WritableValue Interface
        4. Understanding the ReadOnlyProperty Interface
        5. Understanding the Property Interface
        6. Understanding the Binding Interface
      4. Type-Specific Specializations of Key Interfaces
        1. A Common Theme for Type-Specific Interfaces
        2. Commonly Used Classes
      5. Creating Bindings
        1. Understanding the Bindings Utility Class
        2. Understanding the Fluent Interface API
      6. Understanding the JavaFX Beans Convention
        1. The JavaFX Beans Specification
        2. Understanding the Eagerly Instantiated Properties Strategy
        3. Understanding the Lazily Instantiated Properties Strategy
        4. Using Selection Bindings
      7. Adapting JavaBeans Properties to JavaFX Properties
        1. Understanding JavaBeans Properties
        2. Understanding the JavaFX Property Adapters
      8. Summary
      9. Resources
    15. Chapter 5: Building Dynamic UI Layouts in JavaFX
      1. Introducing JavaFX Reversi
        1. Board Layout and Basic Rules
        2. Building a JavaFX Model for Reversi
      2. Dynamic Layout Techniques
        1. Centering Text Using Bind
        2. Centering Revisited Using a StackPane
        3. Aligning to Edges Using StackPanes and TilePanes
        4. Using FlowPane and Boxes for Directional Alignment
        5. Composing a Layout Using BorderPane
      3. Creating Custom Regions
        1. Building a Custom Square Region
        2. Building a Resizable Reversi Piece
      4. Laying Out the Tiles Using a GridPane
      5. Aligning and Stretching with AnchorPane
      6. When to Use Different Layouts
      7. Bringing Reversi to Life
        1. Highlighting Legal Moves
        2. Highlighting the Active Cell
        3. Taking Turns
      8. Declaring the User Interface Using FXML
        1. Additional Game Enhancements
      9. Summary
      10. Resources
    16. Chapter 6: Using the JavaFX UI Controls
      1. Trying Out the JavaFX UI Controls
      2. Leveraging the JavaFX UI Controls
        1. Creating a Menu and Defining Menu Items
        2. Creating a Toolbar
        3. Creating a TableView
        4. Creating an Accordion and Defining a TitledPane
        5. Creating a TreeView
        6. Creating a ListView and Assigning Items to a ListView
        7. Creating a SplitPane
        8. Creating a TreeTableView
        9. Defining a ScrollPane
        10. Using a CheckBox
        11. Defining a RadioButton
        12. Creating a Hyperlink
        13. Defining a ChoiceBox
        14. Using a MenuButton
        15. Creating a ContextMenu
        16. Creating a SplitMenuButton
        17. Defining a TextField
        18. Using a PasswordField
        19. Creating a TextArea
        20. Creating a DatePicker and a ColorPicker
        21. Creating a Slider
        22. Defining a ProgressIndicator
        23. Defining a ScrollBar
        24. Using a ProgressBar
        25. Creating an HTMLEditor
        26. Creating a Popup
        27. Using a WebView
      3. Summary
      4. Resources
    17. Chapter 7: Collections and Concurrency
      1. Understanding Observable Collections and Arrays
        1. Understanding ObservableList
        2. Handling Change Events in ListChangeListener
        3. Understanding ObservableMap
        4. Understanding ObservableSet
        5. Understanding ObservableArrays
        6. Using Factory and Utility Methods from FXCollections
      2. Using the JavaFX Concurrency Framework
        1. Identifying the Threads in a JavaFX Application
        2. Fixing Unresponsive UIs
        3. Understanding the javafx.concurrent Framework
      3. Mixing JavaFX with Other GUI Toolkits
        1. Embedding JavaFX Scenes in Swing Applications
        2. Embedding JavaFX Scenes in SWT Applications
        3. Embedding Swing Components in JavaFX Applications
      4. Summary
      5. Resources
    18. Chapter 8: Creating Charts in JavaFX
      1. Structure of the JavaFX Chart API
      2. Using the JavaFX PieChart
        1. The Simple Example
        2. Some Modifications
      3. Using the XYChart
        1. Using the ScatterChart
        2. Using the LineChart
        3. Using the BarChart
        4. Using the StackedBarChart
        5. Using the AreaChart
        6. Using the StackedAreaChart
        7. Using the BubbleChart
      4. Summary
      5. Resources
    19. Chapter 9: Using the Media Classes
      1. The Foundation
      2. Supported Media Formats
      3. Working with Audio Clips
        1. Controlling the Playback Parameters of an AudioClip
        2. Constructing the Scene
        3. AudioClip Wrap-Up
      4. Working with Media
      5. Playing Audio
        1. Error Handling
        2. Displaying Metadata
        3. Loading Media
        4. Controlling Playback
        5. Audio Equalization
        6. MediaPlayer Wrap-Up
      6. Playing Video
        1. Controlling the Size of a MediaView
        2. MediaView and Effects
        3. Using Markers
        4. One Player, Multiple Views
      7. Converting AudioPlayer into a VideoPlayer
      8. Summary
      9. Resources
    20. Chapter 10: JavaFX 3D
      1. Overview
      2. Understanding JavaFX 3D Objects
        1. Understanding the Shape3D Base Class
        2. Creating Predefined 3D Shapes
        3. Creating User-Defined 3D Shapes
      3. Adding Cameras to JavaFX 3D Scenes
        1. Understanding the PerspectiveCamera
      4. Adding Lights to JavaFX Scenes
        1. Understanding the LightBase Class
        2. Understanding the AmbientLight Class
        3. Understanding the PointLight Class
        4. Understanding SubScenes
      5. Specifying the Material of 3D Shapes
        1. Understanding the PhongMaterial Class
        2. Adding Texture to 3D Shapes
      6. Interacting with JavaFX 3D Scenes
        1. Understanding the PickResult Class
      7. Understanding the Canvas and Image Ops APIs
        1. Understanding the Canvas API
        2. Understanding the Image Ops API
      8. Summary
      9. Resources
    21. Chapter 11: Accessing Web Services
      1. Front-End and Back-End Platforms
      2. Merging JavaFX and Java Enterprise Modules in the Same Environment
      3. Using JavaFX to Call Remote (Web) Services
        1. SOAP
        2. REST
      4. Summary
    22. Chapter 12: JavaFX on Embedded and Mobile
      1. OpenJFX, the Origin of the Code
      2. JavaFX on ARM
        1. The Raspberry Pi
        2. JavaFX on the Raspberry Pi
        3. Deploying JavaFX Applications on the Embedded ARM Systems
      3. JavaFX on Mobile
        1. JavaFX on iOS
        2. JavaFX on Android
      4. JavaFXPorts, Putting It All Together
      5. Summary
      6. Resources
    23. Chapter 13: JavaFX Languages and Markup
      1. A Quick Comparison of Alternative Languages
        1. Vanishing Circles in Java
        2. Vanishing Circles in Alternative JVM Languages
      2. Making Your JavaFX Groovy
        1. Introduction to GroovyFX
        2. Properties in GroovyFX
        3. GroovyFX Binding
        4. GroovyFX API Enhancements
      3. Scala and JavaFX
        1. Getting Started with ScalaFX
        2. ScalaFX Proxies and Implicit Conversions
        3. JavaFX Properties in Scala
        4. ScalaFX Bind APIs
        5. API Enhancements
      4. Summary
      5. Resources
    24. Index

    Product information

    • Title: Pro JavaFX 8
    • Author(s):
    • Release date: July 2014
    • Publisher(s): Apress
    • ISBN: 9781430265757