How-To's > How do I use asynchronous processes?


Because JavaFX code is executed on the Event Dispatch Thread, any blocking operation, such as an I/O operation or database access, can hang the user interface. To avoid the possibility of hanging, any potential blocking operations must run on a different thread.

JavaFX provides asynchronous APIs to handle cases in which there can be blocking operations. This means that an application can have multiple tasks running concurrently, with some of the tasks running in the background. The asynchronous task model is implemented with the javafx.async package.

In addition, it is possible to load images in the background by using the backgroundLoading variable in the Image and FXDNode classes. For examples of loading images asynchronously, see the topic How do I work with images?

The following links are some starting points for the asynchronous process task model and javafx.async API. They were written for JavaFX 1.2, but are still valid for Version 1.3.

Last Updated: April 2010
[Return to How-To's Home]