17. In a JavaFX application, the values needed to construct a scene are a. a sta
ID: 3686632 • Letter: 1
Question
17. In a JavaFX application, the values needed to construct a scene are
a. a stage b. an instance of the Node class, with optional width and height values to define the dimensions of the scene c. an instance of the Parent class, with optional width and height values to define the dimensions of the scene d. a VBox object
18. In a JavaFX application
a. the developer must write code to create a stage b. the stage object is created while the program is being compiled c. the stage is created by the system without the developer writing code to create it d. none of the above
Explanation / Answer
17. The correct option is c. an instance of the Parent class, with optional width and height values to
define the dimensions of the scene.
Explanation:
The creation of Scene object
Group root=new Group();
Scene scene=new Scene(root);
It is optional to set width, height or can set widht and height
Since Scene class has parameterized constructor for
Parent class and Parent , widht and height values
18. The correct option is a. the developer must write code to create a stage.
Explanation:
In start method of the JavaFX application, the stage must be created
with root with optional widht and height values.
//sample scene creation with root
public void start(Stage stage) {
Group root = new Group();
Scene scene = new Scene(root)
stage.setScene(scene);
stage.show();
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.