You are previewing JavaFX For Dummies.
O'Reilly logo
JavaFX For Dummies

Book Description

Unleash the power of JavaFX for a wide range of devices

JavaFX For Dummies gives you access to an innovative software platform that allows you to create and deliver rich Internet applications that can run across a wide variety of connected devices. This accessible book highlights the most important features of this powerful graphics platform, giving you the tools to understand it quickly and easily! No experience with JavaFX? No problem. JavaFX For Dummies has been written especially for newbies and it also serves as a great reference resource for more experienced Java developers.

Author Doug Lowe has been writing programming books for decades, and he brings his experience and passion to this guide, sharing his expert approach to coding using JavaFX. The book shows you how to work with JavaFX controls, how to enhance your scenic design, and also offers advice on how to make a splash with your programs. Then, the author wraps it all up with extra recommendations and resources to guide you as you move forward.

  • Helps developers quickly learn to take advantage of JavaFX's lightweight, high-performance platform

  • Highlights essential JavaFX features for simple coding that can be rolled out across multiple devices

  • Instructs readers on methods for creating compelling, visually appealing applications

  • Includes recommendations and resources for honing your JavaFX skills

  • With JavaFX For Dummies, you'll be on your way to easier, more efficient coding for a variety of connected devices.

    Table of Contents

      1. Introduction
        1. About This Book
        2. Foolish Assumptions
        3. How This Book Is Organized
          1. Part I: Getting Started with JavaFX
          2. Part II: JavaFX Controls
          3. Part III: Enhancing Your Scenic Design
          4. Part IV: Making Your Programs Come Alive
          5. Part V: The Part of Tens
        4. Icons Used in This Book
        5. Beyond the Book
        6. Where to Go from Here
      2. Part I: Getting Started with JavaFX
        1. Chapter 1: Hello, JavaFX!
          1. What Is JavaFX?
          2. Perusing the Possibilities of JavaFX
          3. Looking at a Simple JavaFX Program
          4. Downloading and Installing JavaFX
            1. Downloading JDK 8
            2. Installing JDK 8
            3. Setting the path
          5. Developing the Click Me Program with Notepad
          6. Developing the Click Me Program with TextPad
          7. Using an IDE to Create the Click Me Program
        2. Chapter 2: Looking Closer at JavaFX Programming
          1. Looking Again at the Click Me Program
          2. Importing JavaFX Packages
          3. Extending the Application Class
          4. Launching the Application
          5. Overriding the start Method
          6. Creating a Button
          7. Handling an Action Event
          8. Creating a Layout Pane
          9. Making a Scene
          10. Setting the Stage
          11. Examining the Click Counter Program
        3. Chapter 3: Handling Events
          1. Examining Events
          2. Handling Events
          3. Implementing the EventHandler Interface
          4. Handling Events with Inner Classes
          5. Handling Events with Anonymous Inner Classes
          6. Using Lambda Expressions to Handle Events
        4. Chapter 4: Setting the Stage and Scene Layout
          1. Examining the Stage Class
          2. Examining the Scene Class
          3. Switching Scenes
          4. Creating a Dialog Box
          5. Creating a Confirmation Box
          6. Exit, Stage Right
            1. Creating a Close button
            2. Handling the CloseRequest event
            3. Putting it all together
        5. Chapter 5: Using Layout Panes to Arrange Your Scenes
          1. Working with Layout Panes
            1. Introducing four JavaFX layout panes
            2. Creating layout panes
            3. Combining layout panes
          2. Using the HBox Layout
          3. Spacing Things Out
          4. Adding Space with Margins
          5. Adding Space by Growing Nodes
          6. Using the VBox Layout
          7. Aligning Nodes in a Layout Pane
          8. Making Nodes the Same Width
          9. Using the Flow Layout
          10. Using the Border Layout
        6. Chapter 6: Getting Input from the User
          1. Using Text Fields
          2. Validating Numeric Data
          3. Using Check Boxes
          4. Using Radio Buttons
          5. Looking at a Pizza Order Application
      3. Part II: JavaFX Controls
        1. Chapter 7: Introducing the JavaFX Node Hierarchy
          1. An Overview of JavaFX Packages
          2. The Node Class
          3. The Parent Class
          4. The Region Class
          5. The Control Class
        2. Chapter 8: Choosing from a List
          1. Using Choice Boxes
            1. Creating a choice box
            2. Setting a default value
            3. Getting the selected item
          2. Working with Observable Lists
          3. Listening for Selection Changes
          4. Using Combo Boxes
            1. Creating combo boxes
            2. Getting the selected item
            3. Handling combo box events
          5. Using List Views
            1. Creating a list view
            2. Getting the selected items
          6. Using Tree Views
            1. Building a tree
            2. Creating a TreeView control
            3. Getting the selected node
            4. Looking at a complete program that uses a tree view
        3. Chapter 9: Working with Tables
          1. Creating the Data for a Table
          2. Creating a Read-Only Table
            1. Using the TableColumn class
            2. Using the TableView class
          3. A Program That Creates a Read-Only Table
          4. Creating an Editable Table
            1. Adding table rows
            2. Deleting table rows
            3. Editing table cells
          5. A Program That Creates an Editable Table
        4. Chapter 10: Making Menus
          1. Introducing Classes for Creating Menus
          2. Creating a Basic Menu Bar
          3. Creating Menus
          4. Creating Menu Items
          5. Using Separators
          6. Using Action Listeners
          7. Creating Menus That Change
          8. Using Check and Radio Menu Items
          9. Creating Submenus
          10. Creating Custom Menu Items
      4. Part III: Enhancing Your Scenic Design
        1. Chapter 11: More about Layout Panes for Precise Scene Design
          1. Using the StackPane Layout
          2. Using the TilePane layout
          3. Using the ScrollPane Layout
          4. Using the GridPane Layout
            1. Sketching out a plan
            2. Creating a grid pane
            3. Working with grid pane constraints
            4. Examining a grid pane example
        2. Chapter 12: Skinning Your Application with CSS
          1. Using Default Style Sheets
          2. Adding a Style Sheet to a Scene
          3. Using Inline Styling
          4. Creating a Style Sheet
            1. Using type selectors
            2. Creating your own style class names
            3. Using id selectors
            4. Using multiple selectors
          5. Specifying Style Properties
            1. Specifying font properties
            2. Specifying background colors
            3. Specifying border properties
        3. Chapter 13: Drawing Shapes
          1. Introducing the Shape Class
            1. Creating lines
            2. Creating rectangles
            3. Creating circles and ellipses
            4. Creating arcs
            5. Looking at the ShapeMaker program
          2. Fancy Fills
            1. Drawing transparently
            2. Using a gradient fill
          3. Translating, Scaling, and Rotating
          4. Drawing Text
          5. Combining Shapes
        4. Chapter 14: Adding Special Effects
          1. Introducing Special Effects
          2. Adding Shadows
          3. Creating Reflections
          4. Making Things Blurry
          5. Blooming and Glowing
          6. Gaining Perspective
          7. Combining Effects
      5. Part IV: Making Your Programs Come Alive
        1. Chapter 15: Using Properties to Create Dynamic Scenes
          1. Introducing JavaFX Properties
          2. Java API Properties
          3. JavaFX Property Classes
          4. Creating a Read/Write Property
          5. Creating a Read-Only Property
          6. Creating Properties More Efficiently
          7. Using Property Events
          8. Binding Properties
        2. Chapter 16: Using Images and Media
          1. Using Images
            1. Using the Image class
            2. Using the ImageView class
            3. Viewing an Image example
          2. Playing Audio Files
          3. Playing Video Files
        3. Chapter 17: Animating Your Scenes
          1. Introducing JavaFX Animation
          2. Using Transition Classes
          3. Looking at a Transition Example
          4. Combining Transitions
          5. Animating the Hard Way
          6. Improving the Ball Bouncer
        4. Chapter 18: Targeting Touch Devices
          1. Introducing Gestures and Touch Events
          2. Listening for Gestures
          3. Looking at an Example Program
      6. Part V: The Part of Tens
        1. Chapter 19: Ten More JavaFX Controls
          1. TitledPane
          2. Accordion
          3. ColorPicker
          4. DatePicker
          5. Hyperlink
          6. ProgressIndicator and ProgressBar
          7. Slider
          8. ScrollBar
          9. PasswordField
        2. Chapter 20: Ten Steps to Building a 3D World
          1. Step One: Add a Perspective Camera
          2. Step Two: Add a Cylinder
          3. Step Three: Create a Material
          4. Step Four: Translate the Cylinder
          5. Step Five: Add a Box
          6. Step Six: Rotate the Box
          7. Step Seven: Add a Sphere
          8. Step Eight: Add a Mesh Object
          9. Step Nine: Animate the Objects
          10. Step Ten: Add a Light Source
          11. Putting It All Together: The Complete 3D World Program
      7. About the Author
      8. Cheat Sheet
      9. More Dummies Products