Java Reference
In-Depth Information
Ask the Expert
Q :
What other text controls does JavaFX support?
A : Other text controls include TextArea , which supports multiline text, and Pass-
wordField , which can be used to input passwords. You might also find HTMLEdit-
or helpful.
Introducing Effects and Transforms
A principal advantage of JavaFX is its ability to alter the precise look of a control (or any
node in the scene graph) through the application of an effect and/or a transform . Both ef-
fects and transforms help give your GUI the sophisticated, modern look that users have
come to expect. As you will see, the ease with which effects and/or transforms can be used
in JavaFX is one of its strongest features. Although the topic of effects and transforms is
quite large, the following introduction will give you an idea of the benefits they provide.
Effects
Effects are supported by the abstract Effect class and its concrete subclasses, which are
packaged in javafx.scene.effect . Using these effects, you can customize the way a node in
a scene graph looks. Several built-in effects are provided. Here is a sampling:
Bloom Increases the brightness of the brighter parts of a node.
BoxBlur Blurs a node.
DropShadow Displays a shadow that appears behind the node.
Glow Produces a glowing effect.
InnerShadow Displays a shadow inside a node.
Lighting
Creates the shadow effects of a light source.
Reflection
Displays a reflection.
These, and the other effects, are easy to use and are available to any Node , including con-
trols. Of course, depending on the control, some effects will be more appropriate than oth-
ers.
To set an effect on a node, call setEffect( ) , which is defined by Node . It is shown here:
Search WWH ::




Custom Search