Java Reference
In-Depth Information
Figure 7-21.
The
SwingComponentInJavaFXExample
program
■
in case you are wondering if there is a way to embed an sWt widget into a JavaFX application, the answer is no.
the reason is that sWt widgets are heavyweight components and thus harder to integrate into a lightweight Gui toolkit
like JavaFX.
Tip
Summary
In this chapter, we looked at JavaFX observable collections, the JavaFX worker threading framework, embedding a
JavaFX scene in Swing and SWT applications, and embedding Swing components in JavaFX applications to help you
understand the following principles and techniques.
ObservableList
,
ObservableMap
,
ObservableSet
, and
ObservableArray
, with subinterfaces
ObservableIntegerArray
and
ObservableFloatArray
.
•
ObservableList
fires
Change
events through
ListChangeListener
.
ListChangeListener.
Change
may contain one or more discrete changes.
•
ObservableMap
fires
Change
events through
MapChangeListener
.
MapChangeListener.Change
represents the change of only one key.
•
ObservableSet
fires
Change
events through
SetChangeListener
.
SetChangeListener.Change
represents the change of only one element.
•
ObservableArray
and its subinterfaces fire change events through
ArrayChangeListener
.
•
JavaFX supports observable collections and arrays:
FXCollections
class contains factory methods to create observable collections and
arrays, and utility methods to work on them.
•
The
•
The main event processing thread in JavaFX applications is the JavaFX application thread.
All access to live scenes must be done through the JavaFX application thread.
Search WWH ::
Custom Search