O'Reilly logo

Learn JavaFX 8: Building User Experience and Interfaces with Java 8 by Kishori Sharan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 27

image

Understanding Concurrency in JavaFX

In this chapter, you will learn:

  • Why you need a concurrency framework in JavaFX
  • How the Worker<V> interface represents a concurrent task
  • How to run a one-time task
  • How to run a reusable task
  • How to run a scheduled task

The Need for a Concurrency Framework

Java (including JavaFX) GUI (graphical user interface) applications are inherently multithreaded. Multiple threads perform different tasks to keep the UI in sync with the user actions. JavaFX, like Swing and AWT, uses a single thread, called JavaFX Application Thread, to process all UI events. The nodes representing UI in a scene graph are not thread-safe. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required