0% found this document useful (0 votes)
70 views5 pages

Quiz 9

The document contains a quiz with multiple-choice questions related to JavaFX, covering topics such as root nodes, setting stage titles, JavaFX nodes, color creation, and mouse events. Each question includes options for answers, with some marked as correct or incorrect. The quiz aims to assess knowledge of JavaFX features and syntax.

Uploaded by

Muhammad Naafis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views5 pages

Quiz 9

The document contains a quiz with multiple-choice questions related to JavaFX, covering topics such as root nodes, setting stage titles, JavaFX nodes, color creation, and mouse events. Each question includes options for answers, with some marked as correct or incorrect. The quiz aims to assess knowledge of JavaFX features and syntax.

Uploaded by

Muhammad Naafis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

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

You might also like