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:

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



Rate This Article
Leave a Comment or Suggest a Topic

Do you have comments about this article? We welcome your participation in our community. Please keep your comments civil and on point. You may optionally provide your email address to be notified of replies—your information is not used for any other purpose. By submitting a comment, you agree to these Terms of Use.

 

English
日本語
한국어
简体中文
русский
Português do Brasil