Section 9 Quiz
(Answer all questions in this section)
1. Which type of Root Node allows Nodes to be placed anywhere? Mark
for Review
(1) Points
TilePane
Group (*)
HBox
StackPane
Incorrect Incorrect. Refer to Section 9 Lesson 1.
2. How would you set the title of the Stage primaryStage? Mark
for Review
(1) Points
primaryStage("New Title!");
primaryStage = "New Title!;
primaryStage.title = "New Title!";
primaryStage.setTitle("New Title!"); (*)
Correct Correct
3. The start() method is the entry point for all JavaFX
applications. Mark for Review
(1) Points
True (*)
False
Correct Correct
4. JavaFX is used to create GUI applications. Mark for Review
(1) Points
True (*)
False
Correct Correct
5. Which is not a JavaFX Node? Mark for Review
(1) Points
Object (*)
ScrollBar
ImageView
Button
Correct Correct
6. How would you create a custom color that is pure cyan (equal parts green and
blue)? Mark for Review
(1) Points
Color customColor = Color.rgb(0, 255, 0);
Color customColor = Color.rgb(255, 255, 0);
Color customColor = Color.rgb(0, 0, 255);
Color customColor = Color.rgb(0, 255, 255); (*)
Correct Correct
7. Which color is not directly used when creating custom
Color.rgb()? Mark for Review
(1) Points
Yellow (*)
Blue
Red
Green
Correct Correct
8. Which is the correct syntax to instantiate a JavaFX Rectangle?
Mark for Review
(1) Points
Rectangle rect = new Rectangle(20, 20, 100);
Rectangle rect = new Rectangle(20, 20, 100, 200); (*)
Rectangle rect = Rectangle(20, 20, 100, 200);
Rectangle rect = new Rectangle(20, 20);
Correct Correct
9. Which method helps to set the width of a rectangle�s outline?
Mark for Review
(1) Points
setLayoutX(double d)
setStrokeWidth(double d) (*)
setStroke(Paint paint)
setX(double d)
Incorrect Incorrect. Refer to Section 9 Lesson 2.
10. JavaFX Ensemble contains code examples of JavaFX features. Mark
for Review
(1) Points
True (*)
False
Correct Correct
11. When you write code for MouseEvents, you are telling a Node to listen for a
particular event. Mark for Review
(1) Points
True (*)
False
Incorrect Incorrect. Refer to Section 9 Lesson 3.
12. An Image is an object that describes the location of a graphics
file. Mark for Review
(1) Points
True (*)
False
Correct Correct
13. Which method is used to for mouse click events? Mark for Review
(1) Points
setOnMouseReleased()
setOnMouseClicked() (*)
setOnMouseMoved()
setOnMouseDragged()
Correct Correct
14. Lambda Expressions provide much more effective and cleaner syntax
for working with GUI applications and sorting lists. Mark for Review
(1) Points
True (*)
False
Correct Correct
15. Audio can be played by referencing the Audio object directly.
Mark for Review
(1) Points
True (*)
False
Correct Correct