Self-Review Exercises 2
Self-Review Exercises
22.1 Fill in the blanks in each of the following statements:
a) Selectors that begin with are known as ID selectors—they are applied to ob-
jects with the specified ID.
b) XML comments begin with and end with –> and can span multiple lines.
c) The x– and y-coordinate values are measured by default from the corner of
the layout, with x-coordinates increasing left to right and y-coordinates increasing top
to bottom.
d) The CSS property indicates how lines should be terminated.
e) A(n) defines colors that transition gradually from one color to the next.
f) A(n) can be applied to any UI element to reposition or reorient the graphic.
g) To perform a task for a given state of a MediaPlayer, you specify an object that imple-
ments interface (package java.lang).
h) A FadeTransition changes a Node’s .
i) Each Transition animation uses a(n) to calculate new property values
throughout the animation’s duration.
j) Package javafx.scene.canvas contains two classes: Canvas is a subclass of Node in which
you can draw graphics and performs the drawing operations on a Canvas.
k) objects represent color stops in a gradient.
l) Colors and images you see on three-dimensional shapes are created by applying
to the shapes.
m) JavaFX class is used to define materials.
22.2 State whether each of the following is true or false. If false, explain why.
a) Each CSS rule begins with a CSS collector which specifies the JavaFX objects that will
be styled according to the rule.
b) An XML start tag consists of square brackets ([ and ]) containing the element’s name
followed by zero or more attributes.
c) It’s possible to load CSS files dynamically and add them to a Scene’s collection of style
sheets, which you can access via the getStyleSheets method.
d) For each property you set in Scene Builder, there is a corresponding attribute in FXML.