HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Rough Cuts are manuscripts that are developed but not yet published, available through Safari. Rough Cuts provide you access to the very latest information on a given topic and offer you the opportunity to interact with the author to influence the final publication.
This is the Rough Cut version of the printed book.
Updated for JavaFX 1.3
The JavaFX platform makes it possible to write applications that can be deployed across devices ranging from cell phones to desktops, with little or no change required. JavaFX applications are written using JavaFX Script, a new and easy-to-use scripting language.
Kim Topley’s JavaFX™ Developer’s Guide thoroughly covers the JavaFX language and its core libraries and shows you step by step how to develop and deliver JavaFX applications for the desktop and for mobile devices. It provides complete coverage of all aspects of the language, including
Topley highlights critical topics that other books gloss over, presents detailed examples that stretch JavaFX to its limits, and shows you exactly how to build on the skills you already have. Whether you’ve been focused on HTML/XML/CSS Web development or Java Swing, this book will help you get outstanding results with JavaFX.
About the Author xxv
Preface xxvi
Part I: Introduction to JavaFX
Chapter 1: An Overview of JavaFX 3
The JavaFX Platform 3
The JavaFX Script Language 5
The JavaFX Runtime 9
JavaFX Development Tools 13
Deployment 14
Chapter 2: JavaFX Script Basics 17
Source File Structure 17
Comments 18
The package Statement 20
The import Statement 20
Other JavaFX Statements 23
JavaFX Keywords and Reserved Words 27
Script Execution and Arguments 28
Predefined Variables 31
Chapter 3: JavaFX Script Development 33
Compiling and Running JavaFX Code 33
Documentation in JavaFX Source Code 43
Chapter 4: A Simple JavaFX Application 45
Building the SnowStorm Application 46
SnowStorm on the Web, a Phone, and TV 65
Debugging the SnowStorm Application 72
Profiling the SnowStorm Application 77
Source Code for the SnowStorm Application 82
Part II: The JavaFX Script Language
Chapter 5: Variables and Data Types 89
Variable Declarations 89
Object Types 94
Basic Data Types 97
Type Inference 117
Visibility of Variables 119
Chapter 6: Expressions, Functions, and Object Literals 121
Expressions and Operations 121
JavaFX Functions 134
Object Literals 147
Chapter 7: Sequences 153
Sequence Creation 153
The String Form of a Sequence 155
Range Notation 156
Sequence Equality and Copying 157
Querying Sequences 158
Modifying Sequences 162
Operations on Sequences 167
Java Arrays 174
Chapter 8: Controlling Program Flow 179
The if Statement 179
The while Statement 181
The for Statement 184
Exception Handling 193
Chapter 9: Binding 195
Binding to Variables and Expressions 195
Binding and Functions 207
Binding and Sequences 217
Chapter 10: Triggers 221
Triggers on Simple Variables 221
Triggers and Sequences 229
Triggers and Instance Variables 236
Chapter 11: JavaFX Sc