Synopses & Reviews
Build Rich Applications that Run on the Desktop, the Web, Mobile Devices...Anywhere!
Using JavaFX, developers and graphic designers can work together to build robust, immersive applications and deploy them anywhere: on the desktop, on the Web, and on millions of Java-enabled mobile devices. JavaFX lets you maintain your existing graphics and seamlessly integrate them into Java applications. Plus, JavaFX Script is a declarative language that allows you to preserve your investment in the Java platform while allowing more creativity with JavaFX’s Rich Internet Application environment.
JavaFX™: Developing Rich Internet Applications brings together all the knowledge, techniques, and reusable code you need to quickly deliver production-quality solutions. Writing for both developers and designers, the authors explain how JavaFX simplifies and improves the RIA development process, and they show how to make the most of its ready-built components and frameworks.
JavaFX™ covers everything from data integration to multimedia, special effects to REST. The authors present a full chapter of code recipes and a complete case study application. This book’s wide-ranging content includes
- Building and running JavaFX programs
- Understanding the role of graphics designers in creating JavaFX Graphical Assets
- Writing fast, efficient JavaFX Script programs
- Using data binding to simplify Model-View-Controller application design
- Creating rich user experiences with JavaFX visual components
- Bringing user interfaces to life with lighting, reflection, and other special effects
- Adding motion with the JavaFX animation framework
- Incorporating pictures, sound, and videos in your applications
- Creating RESTful applications with JSON and XML
- Writing JavaFX applications that make the most of the underlying Java platform
The Java™ Series is supported, endorsed, and authored by the creators of the Java technology at Sun Microsystems, Inc. It is the official place to go for complete, expert, and definitive information on Java technology. The books in this Series provide the inside information you need to build effective, robust, and portable applications and applets. The Series is an indispensable resource for anyone targeting the Java platform.
About the Author
Jim Clarke is a principle technologist with Sun Microsystems and has spent the last twelve years developing with the Java platform. Prior to that, Jim specialized in distributed object technologies. For the past two years, Jim has been working directly with JavaFX and was a part of the JavaFX compiler team. Jim is a graduate of the University of Notre Dame and has been in the computer science field for thirty years. You can catch his blog at http://blogs.sun.com/clarkeman/.
Jim Connors, a long-time member of Sun’s system engineering community, has spent the last decade helping customers further utilize Java technology ranging from Java Card and Java Micro Edition through Java Enterprise Edition. His current focus involves providing software solutions to Sun’s embedded market, including real-time Java, Solaris, and most recently JavaFX. Jim has twenty-five years’ experience in systems software development including stints as a compiler developer for both the C and ADA programming languages. Along with Jim Clarke and Eric Bruno, Jim developed and demonstrated one of the first applications utilizing JavaFX Script back at JavaONE 2007. A regular blogger, you can read his occasional rantings at http://blogs.sun.com/jtc.
Eric Bruno is a systems engineer at Sun, with a focus on Java RTS in the financial community. He is the author of the books Java Messaging and Real-Time Java Programming and has dozens of technology articles to his name. He is currently a contributing editor for Dr. Dobb's Journal and writes their online Java blog. Prior to Sun, Eric worked at Reuters where he developed real-time trading systems, order-entry and routing systems, as well as real-time news and quotes feeds, in both Java and C++.
Table of Contents
Foreword xiii
Preface xv
Acknowledgments xxi
About the Authors xxiii
Chapter 1: Getting Started 1
Installing the JavaFX Platform 1
Setting Up NetBeans IDE for JavaFX 1.2 2
Command Line 9
Eclipse 13
Chapter Summary 18
Chapter 2: JavaFX for the Graphic Designer 19
Graphic Design and JavaFX 19
JavaFX Production Suite 20
Adobe Illustrator CS3 20
Adobe Photoshop CS3 26
Scalable Vector Graphics 30
Chapter Summary 31
Chapter 3: JavaFX Primer 33
JavaFX Script Basics 33
JavaFX Script Language 34
Class Declaration 36
Mixin Classes 38
Object Literals 40
Variables 41
Sequences 45
Functions 49
Strings 50
Expressions and Operators 55
Chapter Summary 64
Chapter 4: Synchronize Data Models–Binding and Triggers 65
Binding 65
Bidirectional Binding 77
Advanced Binding Topics 80
Triggers 85
Coming Features 91
Chapter Summary 92
Chapter 5: Create User Interfaces 93
User Interfaces 93
The Stage 93
The Scene 96
Nodes 105
Layout 108
Input Events 121
Text Display 125
Custom Controls 136
Shapes 140
Java Swing Extension 145
Chapter Summary 150
Chapter 6: Apply Special Effects 151
Effects 152
Chapter Summary 180
Chapter 7: Add Motion with JavaFX Animation 181
Computer Animation 181
Timelines 183
Key Frames 185
Interpolation 189
Path-Based Animation 199
Total Solar Eclipse Examples 205
Chapter Summary 218
Chapter 8: Include Multimedia 219
Multimedia 219
Images 219
Media–Audio and Video 225
Chapter Summary 234
Chapter 9: Add JavaFX to Web Pages with Applets 235
JavaFX and Applets 235
Deploying a JavaFX Application as an Applet 235
Java Web Start 256
Chapter Summary 258
Chapter 10: Create RESTful Applications 259
What Is REST? 259
JavaScript Object Notation (JSON) 264
JavaFX and REST 266
JavaFX and XML 277
Chapter Summary 278
Chapter 11: JavaFX and Java Technology 279
Classes 280
Java Objects 281
Function Parameter and Return Mapping 284
Java Scripting 293
JavaFX Reflection 299
Chapter Summary 302
Chapter 12: JavaFX Code Recipes 303
JavaFX and JavaBeans 303
Server Call Back 307
Node Effects–Fader and Magnifier 311
Wizard Framework 319
Progress Bar 325
Slider 327
Matrix 330
Chapter Summary 332
Chapter 13: Sudoku Application 333
How to Access the JavaFX Sudoku Application 334
The Interface 334
Source for the Sudoku Application 336
The Overall Design 338
Interfacing with Java Components 342
Chapter Summary 346
Index 347