Book description
Learn JavaFX 8 shows you how to start developing rich-client desktop applications using your Java skills and provides comprehensive coverage of JavaFX 8's features. Each chapter starts with an introduction to the topic at hand, followed by a step-by-step discussion of the topic with small snippets of code. The book contains numerous figures aiding readers in visualizing the GUI that is built at every step in the discussion.
The book starts with an introduction to JavaFX and its history. It lists the system requirements and the steps to start developing JavaFX applications. It shows you how to create a Hello World application in JavaFX, explaining every line of code in the process. Later in the book, author Kishori Sharan discusses advanced topics such as 2D and 3D graphics, charts, FXML, advanced controls, and printing. Some of the advanced controls such as TableView, TreeTableView and WebView are covered at length in separate chapters.
This book provides complete and comprehensive coverage of JavaFX 8 features; uses an incremental approach to teach JavaFX, assuming no prior GUI knowledge; includes code snippets, complete programs, and pictures; covers MVC patterns using JavaFX; and covers advanced topics such as FXML, effects, transformations, charts, images, canvas, audio and video, DnD, and more. So, after reading and using this book, you'll come away with a comprehensive introduction to the JavaFX APIs as found in the new Java 8 platform.
Table of contents
- Cover
- Title
- Copyright
- Dedication
- Contents at a Glance
- Contents
- About the Author
- About the Technical Reviewers
- Acknowledgments
- Introduction
-
Chapter 1: Getting Started
- What Is JavaFX?
- History of JavaFX
- System Requirements
- JavaFX Runtime Library
- JavaFX Source Code
- Your First JavaFX Application
- Improving the HelloFX Application
- Using the NetBeans IDE
- Passing Parameters to a JavaFX Application
- Launching a JavaFX Application
- The Life Cycle of a JavaFX Application
- Terminating a JavaFX Application
- Summary
-
Chapter 2: Properties and Bindings
- What Is a Property?
- What Is a Binding?
- Understanding Bindings Support in JavaBeans
- Understanding Properties in JavaFX
- Using Properties in JavaFX Beans
- Lazily Instantiating Property Objects
- Understanding the Property Class Hierarchy
- Handling Property Invalidation Events
- Handling Property Change Events
- Avoiding Memory Leaks in Listeners
- Handling Invalidation and Change Events
- Using Bindings in JavaFX
- Unidirectional and Bidirectional Bindings
- Understanding the Binding API
- Using Bindings to Center a Circle
- Summary
- Chapter 3: Observable Collections
-
Chapter 4: Managing Stages
- Knowing the Details of Your Screens
- What Is a Stage?
- Showing the Primary Stage
- Setting the Bounds of a Stage
- Initializing the Style of a Stage
- Moving an Undecorated Stage
- Initializing Modality of a Stage
- Setting the Opacity of a Stage
- Resizing a Stage
- Showing a Stage in Full-Screen Mode
- Showing a Stage and Waiting for It to Close
- Summary
- Chapter 5: Making Scenes
-
Chapter 6: Understanding Nodes
- What Is a Node?
- The Cartesian Coordinate System
- Cartesian Coordinate System of a Node
- The Concept of Bounds and Bounding Box
- Knowing the Bounds of a Node
- Bounds of a Group
- A Detailed Example on Bounds
- Positioning a Node Using layoutX and layoutY
- Setting the Size of a Node
- Storing User Data in a Node
- What Is a Managed Node?
- Transforming Bounds between Coordinate Spaces
- Summary
- Chapter 7: Playing with Colors
-
Chapter 8: Styling Nodes
- What Is a Cascading Style Sheet?
- What are Styles, Skins, and Themes?
- A Quick Example
- Naming Conventions in JavaFX CSS
- Adding Style Sheets
- Default Style Sheet
- Adding Inline Styles
- Priorities of Styles for a Node
- Inheriting CSS Properties
- Types of CSS Properties
- Specifying Background Colors
- Specifying Borders
- Understanding Style Selectors
- Looking Up Nodes in a Scene Graph
- Using Compiled Style Sheets
- Summary
- Chapter 9: Event Handling
-
Chapter 10: Understanding Layout Panes
- What Is a Layout Pane?
- Layout Pane Classes
- Adding Children to a Layout Pane
- Utility Classes and Enums
- Understanding Group
- Understanding Region
- Understanding Panes
- Understanding HBox
- Understanding VBox
- Understanding FlowPane
- Understanding BorderPane
- Understanding StackPane
- Understanding TilePane
- Understanding GridPane
- Understanding AnchorPane
- Understanding TextFlow
- Snapping to Pixel
- Summary
- Chapter 11: Model-View-Controller Pattern
-
Chapter 12: Understanding Controls
- What Is a Control?
- Understanding Control Classes Hierarchy
- Labeled Controls
- Understanding the Label Control
- Understanding Buttons
- Understanding Command Buttons
- Understanding Choice Buttons
- Understanding the Hybrid Button Control
- Making Selections from a List of Items
- Understanding the ChoiceBox Control
- Understanding the ComboBox Control
- Understanding the ListView Control
- Understanding the ColorPicker Control
- Understanding the DatePicker Control
- Understanding Text Input Controls
- Understanding the TextField Control
- Understanding the PasswordField Control
- Understanding the TextArea Control
- Showing the Progress of a Task
- Understanding the TitledPane Control
- Understanding the Accordion Control
- Understanding the Pagination Control
- Understanding the Tool Tip Control
- Providing Scrolling Features in Controls
- Keeping Things Separate
- Understanding the Slider Control
- Understanding Menus
- Understanding the ContextMenu Control
- Understanding the ToolBar Control
-
Understanding TabPane and Tab
- Creating Tabs
- Setting the Title and Content of Tabs
- Creating TabPanes
- Adding Tabs to a TabPane
- Putting TabPanes and Tabs Together
- Understanding Tab Selection
- Closing Tabs in a TabPane
- Positioning Tabs in a TabPane
- Sizing Tabs in a TabPane
- Using Recessed and Floating TabPanes
- Styling Tab and TabPane with CSS
- Understanding the HTMLEditor Control
- Choosing Files and Directories
- Summary
-
Chapter 13: Understanding TableView
- What Is a TableView ?
- Creating a TableView
- Using a Map as Items in a TableView
- Sorting Data in a TableView
- Customizing Data Rendering in Cells
- Selecting Cells and Rows in a TableView
- Editing Data in a TableView
- Adding and Deleting Rows in a TableView
- Scrolling in a TableView
- Resizing a TableColumn
- Styling a TableView with CSS
- Summary
- Chapter 14: Understanding TreeView
-
Chapter 15: Understanding TreeTableView
- What Is a TreeTableView?
- Model for TreeTableView
- Creating a TreeTableView
- Sorting Data in a TreeTableView
- Populating a TreeTableColumn with Data
- Showing and Hiding Columns
- Customizing Data Rendering in Cells
- Selecting Cells and Rows in a TreeTableView
- Editing Data in a TableView
- Adding and Deleting Rows in a TableView
- Scrolling in a TreeTableView
- StylingTreeTableView with CSS
- Summary
-
Chapter 16: Browsing Web Pages
- What Is a WebView?
- Creating a Web Browser Component
- Setting Properties for a WebView
- Enhancing the Web Browser Application
- Accessing Browsing History
- Handling JavaScript UI Requests
- Executing JavaScript Code from JavaFX
- Executing JavaFX Code from JavaScript
- Accessing the DOM
- Setting the User-Agent HTTP Header
- Setting a User Style Sheet
- Styling a WebView with CSS
- Summary
- Chapter 17: Understanding 2D Shapes
- Chapter 18: Understanding Text Nodes
- Chapter 19: Understanding 3D Shapes
-
Chapter 20: Applying Effects
- What Is an Effect?
- Chaining Effects
- Shadowing Effects
- Blurring Effects
- The Bloom Effect
- The Glow Effect
- The Reflection Effect
- The SepiaTone Effect
- The DisplacementMap Effect
- The ColorInput Effect
- The ColorAdjust Effect
- The ImageInput Effect
- The Blend Effect
- The Lighting Effect
- The PerspectiveTransform Effect
- Summary
- Chapter 21: Understanding Transformations
-
Chapter 22: Understanding Animation
- What Is Animation?
- Understating Animation Classes
- Understanding Utility Classes
- Understating the Timeline Animation
- Controlling an Animation
- Understanding Cue Points
-
Understanding Transitions
- Understanding the Fade Transition
- Understanding the Fill Transition
- Understanding the Stroke Transition
- Understanding the Translate Transition
- Understanding the Rotate Transition
- Understanding the Scale Transition
- Understanding the Path Transition
- Understanding the Pause Transition
- Understanding the Sequential Transition
- Understanding the Parallel Transition
- Understanding Interpolators
- Summary
-
Chapter 23: Understanding Charts
- What Is a Chart?
- Understating the Chart API
- Styling Charts with CSS
- Data Used in Chart Examples
- Understanding the PieChart
- Understating the XYChart
- Understating the BarChart
- Understating the StackedBarChart
- Understanding the ScatterChart
- Understanding the LineChart
- Understating the BubbleChart
- Understating the AreaChart
- Understanding the StackedAreaChart
- Customizing XYChart Appearance
- Summary
- Chapter 24: Understanding the Image API
- Chapter 25: Drawing on a Canvas
- Chapter 26: Understanding Drag and Drop
- Chapter 27: Understanding Concurrency in JavaFX
-
Chapter 28: Playing Audios and Videos
- Understanding the Media API
- Playing Short Audio Clips
- Playing Media
- A Media Player Example
- Handling Playback Errors
- State Transitions of the MediaPlayer
- Repeating Media Playback
- Tracking Media Time
- Controlling the Playback Rate
- Controlling the Playback Volume
- Positioning the MediaPlayer
- Marking Positions in the Media
- Showing Media Metadata
- Customizing the MediaView
- Developing a Media Player Application
- Summary
-
Chapter 29: Understanding FXML
- What Is FXML?
- Editing FXML Documents
- FXML Basics
- Creating Objects in FXML
- Creating Reusable Objects in FXML
- Specifying Locations in Attributes
- Using Resource Bundles
- Including FXML Files
- Using Constants
- Referencing Another Element
- Copying Elements
- Binding Properties in FXML
- Creating Custom Controls
- Summary
- Chapter 30: Understanding the Print API
- Index
Product information
- Title: Learn JavaFX 8: Building User Experience and Interfaces with Java 8
- Author(s):
- Release date: March 2015
- Publisher(s): Apress
- ISBN: 9781484211427
You might also like
book
Learn JavaFX 17: Building User Experience and Interfaces with Java
This unique in-depth tutorial shows you how to start developing rich-client desktop applications using your Java …
book
Beginning Java 8 APIs, Extensions and Libraries Swing, JavaFX, JavaScript, JDBC and Network Programming APIs
completes the Apress learning Java journey and is a comprehensive approach to learning the Java programming …
book
The Definitive Guide to Modern Java Clients with JavaFX 17: Cross-Platform Mobile and Cloud Development
Build enhanced visual experiences and design and deploy modern, easy-to-maintain, client applications across a variety of …
book
Beginning Java 8 Games Development
Beginning Java 8 Games Development, written by Java expert and author Wallace Jackson, teaches you the …