Friday Aug 24, 2012

Take a snapshot with JavaFX!

JavaFX 2.2 has a "snapshot" feature that enables you to take a picture of any node or scene. Take a look at the API Documentation and you will find new snapshot methods in the javafx.scene.Scene class.

The most basic version has the following signature:

public WritableImage snapshot(WritableImage image)

The WritableImage class (also introduced in JavaFX 2.2) lives in the javafx.scene.image package, and represents a custom graphical image that is constructed from pixels supplied by the application.

In fact, there are 5 new classes in javafx.scene.image:

  • PixelFormat: Defines the layout of data for a pixel of a given format.
  • WritablePixelFormat: Represents a pixel format that can store full colors and so can be used as a destination format to write pixel data from an arbitrary image.
  • PixelReader: Defines methods for retrieving the pixel data from an Image or other surface containing pixels.
  • PixelWriter: Defines methods for writing the pixel data of a WritableImage or other surface containing writable pixels.
  • WritableImage: Represents a custom graphical image that is constructed from pixels supplied by the application, and possibly from PixelReader objects from any number of sources, including images read from a file or URL.

The API documentation contains lots of information, so go investigate and have fun with these useful new classes!

-- Scott Hommel

Tuesday Aug 14, 2012

JavaFX 2.2 Documentation

JavaFX Documentation

The JavaFX documentation has been updated. A new learning trail is available on the landing page to help you manage the look and feel of your JavaFX application. Besides this addition, you can find the following changes:

  • Deploying JavaFX Applications has been heavily revised to incorporate several new deployment features in JDK 7u6/JavaFX 2.2. See What's New for more information.
  • Hybrid applications that use both SWT and JavaFX libraries can benefit from the improved packaging support available in JDK 7u6. For information about how to package SWT-JavaFX applications, see JavaFX Interoperability with SWT.
  • Handling JavaFX Events has been updated with information on touch and gesture events. The Working with Events from Touch-Enabled Devices chapter and sample provide information on handling events from touch-enabled devices.
  • The Deployment chapter in Getting Started with JavaFX introduces self-contained applications, which are explained in more detail in the Deployment Guide.
  • Two chapters were added to Using JavaFX UI Controls to introduce the Color Picker and Pagination controls. The Color Picker chapter, provides the design overview of the control, and explains how to use it in JavaFX applications. The Pagination chapter teaches how to add a pagination control to your application, manage its page items, and style the elements of the control with CSS styles.
  • Mastering FXML has been updated to include the following chapters:
  • JavaFX for Swing Developers has been updated to include the following chapter:
    • Implementing a Swing Application in JavaFX - a tutorial that shows how to implement a typical Swing application in JavaFXand provides the comparison of some standard implementation patterns in Swing and JavaFX
  • Study Working with Canvas to learn about a new custom image that you can freely draw on. To use it, you simply obtain its GraphicsContext and invoke its methods to render the shapes. You can even use this component to define a simple layer system.
  • Implementing JavaFX Best Practices points out some best coding practices as found in the Henley Sales application. The concepts translate to JavaFX programming in general, so users should keep these suggestions in mind when developing their own applications.
  • Study the modified version of Adding HTML Content to learn how to manage web history in your JavaFX applications.

Our special announcements:

  • JavaFX Scene Builder 1.0 is officially released! The Scene Builder documentation is available at Find out more information about Scene Builder in the Overview document.
  • Starting the 2.2 release of JavaFX, the API documentation is not bundled together with the JavaFX SDK. You can download it from the Documentation section of the Oracle Technology Network.

You can download JavaFX 2.2 from OTN. For all tutorials and API documentation, see

JDK 7u6 Is Released!

The Java SE 7u6 release has gone live! You can download it from the Java SE Downloads page.

The Java™ SE Development Kit 7, Update 6 (JDK 7u6) Release Notes has detailed information about the release, but the highlights of this update include:

  • The first full release of Oracle Java for Mac OS X. You may find the following documentation useful:
  • The Java Access Bridge enables certain Java programs to be visible to assistive technologies on Microsoft Windows systems. For more information on how to enable and test Java Access Bridge, see the Java Accessibility Guide.

Blog about Java technology documentation and news about Java releases.


« August 2012 »