|This is a good book for an experienced developer who wants to get a feel for the basics of developing software with JavaFX. The book is written in a conversational style with plenty of diagrams and images. The authors also point out areas of interest and places where things don’t work the way a Java developer might expect -- like not being able to modify the contents of a sequence that’s passed into a function because it’s passed in by value, not by reference.|
Essential JavaFX is a well written introduction to JavaFX. It is written in a conversational style and there's lots of diagrams and screen shots to break up the text and show you the results of executing the sample code. As the title suggests, the purpose of this book is to get you familiar with the key parts of JavaFX so you can begin writing applications in it right away.
Chapter 1: Getting Started with JavaFX
You'll start with a brief look a the history of JavaFX followed by a briefer description of the three components of the “JavaFX Bundle”; the JavaFX SDK (compiler, runtime tools, and libraries), the NetBeans IDE (their preferred tool for editing, compiling, running and debugging JavaFX code), and the JavaFX Production Suite (a set of tools that let graphics designers export their work so JavaFX developers can use it directly).
Next, you'll learn how to download and install the JavaFX Bundle. The chapter ends by walking you through the steps to create a JavaFX project, entering some code, and running it.
Chapter 2: A Taste of JavaFX
Chapter two introduces a simple but potentially useful application (a guitar tuner) to give you a better feel for what’s involved in writing JavaFX code. This allows the authors to introduce some of the language constructs and philosophy in the context of creating an application so you can see how it all applies.
As you read through the chapter, you’ll see code fragments followed by images showing the results of executing the code. Sadly the images are not in color, though the grayscale they use is adequate for most of the images.
The chapter ends by presenting the complete source code for the guitar tuner application and descriptions of the various parts. While we’ve seen parts of it throughout the chapter, as well as other bits of sample code) it’s nice to see it all in one place so you can read it and see for yourself how well you are picking up the language.
Chapter 3: JavaFX Language
In chapter three you get to go deeper into the details of the JavaFX scripting language including declaring variables (using both the built-in and Java data types), pseudo-variables, expressions, operators, sequences (JavaFX’s version of arrays), writing functions and classes, and working with mixins, binding, and triggers.
The authors take some time and space to examine and explain the language details, and they point out the things that might trip up experienced Java programmers.
Chapter 4: Graphical Objects
Sun promotes JavaFX as making it easy to create applications with great graphics, and in this chapter you'll learn the basics of the JavaFX graphics system, including the Stage, Scene, and Node classes, how to work with Mouse and Keyboard event handlers, and how to deal with the Cursor.
Built in simple Shape classes like Line, Rectangle, Circle, ElipseArc, and Polygon are covered as well as the more complex Shapes like QuadCurve, CubicCurve, PolyLine, SVGPath and Text classes, and the composite shape classes ShapeIntersect and ShapeSubtract.
The chapter ends with a look at Paths, Layout components, and some of the classes used for managing the two dimensional coordinate space within a scene; Point2D, and Rectangle2D.
Chapter 5: User Interface Components
This chapter covers both types of user interface components available in JavaFX; native components and wrapped Java Swing components. There’s a nice example showing how to incorporate the Swing-based components into an application.
The look of a JavaFX component (called its “skin”) is determined by an associated CSS file. The chapter ends by walking you through the creation of a skinnable TextButton component which is added to the example application as part of a popup dialog box.
Chapter 6: Anatomy of a JavaFX Application
In this chapter you get a quick look at how to use object-oriented design principles to create a simple JavaFX application. In the course of creating the application, you’ll also get a feel for how easy it is to use the graphics capabilities of JavaFX (like gradients, drop shadows, and animation) to improve the user experience of an application.
Chapter 7: Animation
The authors refer to animation as the “heart and soul of JavaFX”, and chapter seven shows you how to create simple animations in JavaFX using Timelines, Keyframes and interpolation. After that you'll create more complex animations that include groups of scene graph nodes, transitions (move, scale, fade, and rotate), animating a node along a path using PathTransitions, and using the SequentialTransition and ParallelTransition classes to combine two or more PathTransitions.
Chapter 8: Working with Images
Chapter eight covers the Image and ImageView components and the things you can do with them using JavaFX including scaling, animation, transformations, and effects. In the examples you'll learn how to load and display a single image, perform transformations like scaling, rotation, fading, and adding a reflection to it. Expanding on that, you''ll create a simple gallery that displays multiple images at the same time. In the final example, you'll create a “photo carousel” that displays multiple images traveling along a circular path. By scaling the size of the images as they move along the circle, you make them appear to be moving nearer and farther away, which gives it a nice three-D feeling.
Chapter 9: Web Services
This chapter shows you how to access Web Services using JavaFX. You learn how to use the PullParser to work with data in XML or JSON formats, and how to use the HTTPRequest class to make HTTP requests. You'll see how to take the photo carousel from chapter 8 and connect it to Flickr as an image source.
Chapter 10: Mobile Applications
The last chapter covers what you need to know about creating mobile applications. You’ll learn how to identify that the application is running in a mobile environment, the screen’s orientation, and how to be notified that the orientation has changed. You'll see how to apply this by giving the photo carousel application a makeover to make it “mobile ready.” The chapter ends by taking a sample application from chapter seven and reworking it for the mobile environment.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)