1 1-3 Suppose a JavaFX class has a binding property named weight of the type Dou
ID: 3676473 • Letter: 1
Question
1 1-3 Suppose a JavaFX class has a binding property named weight of the type DoubleProperty. By convention, which of the following methods are defined in the class (choose three)?
A. public double getWeight()
B. public DoubleProperty weightProperty()
C. public void setWeight(double v)
D. public double weightProperty()
E. public DoubleProperty WeightProperty()
2 2-7 To place a node in the left of a BorderPane p, use ___________.
A. p.setLeft(node);
B. p.left(node);
C. p.placeLeft(node);
D. p.setEast(node);
3 3-10 To remove a node from the pane, use ______ (choose two).
A. pane.remove(node);
B. pane.getChildren().remove(node);
C. pane.removeAll(node);
D. pane.getChildren().removeAll(node);
4 4-14 Which of the following statements correctly creates a Color object (choose three)?
A. Color.color(0.3, 0.5, 0.5);
B. Color.color(0.3, 0.5, 0.5, 0.1);
C. new Color(0.3, 0.5, 0.5);
D. new Color(3, 5, 5, 1);
E. new Color(0.3, 0.5, 0.5, 0.1);
5 5-18 Which of the following statements correctly creates a Font object?
A. new Font("Times", 34);
B. Font.font("Times", FontWeight.NORMAL, FontPosture.ITALIC, 34);
C. Font.font("Times", 34);
D. new Font(34);
E. Font.font("Times", FontWeight.NORMAL, 34);
6 6-21 Why is JavaFX preferred?
A. JavaFX has a built-in 3D, animation support, video and audio playback, and runs as a standalone application or from a browser.
B. JavaFX incorporates modern GUI technologies to enable you to develop rich Internet applications.
C. JavaFX provides a multi-touch support for touch-enabled devices such as tablets and smart phones.
D. JavaFX is much simpler to learn and use for new Java programmers.
7 7-24 Which of the following statements correctly rotates the button 45 degrees counterclockwise (choose two)?
A. button.setRotate(Math.toRadians(45));
B. button.setRotate(-45);
C. button.setRotate(360 - 45);
D. button.setRotate(45);
8 8-28 To add two nodes node1 and node2 into a pane, use ______.
A. pane.getChildren().add(node1, node2);
B. pane.addAll(node1, node2);
C. pane.add(node1, node2);
D. pane.getChildren().addAll(node1, node2);
9 9-33 Which of the following statements are correct (choose four)?
A. Scene is a subclass on Node.
B. Every subclass of Node has a no-arg constructor.
C. Button is a subclass of Node.
D. Circle is a subclass of Node.
E. Pane is a subclass of Node.
10 10-36 What is the output of the following JavaFX program?
import javafx.application.Application;
import javafx.stage.Stage;
public class Test extends Application {
public Test() {
System.out.println("Test constructor is invoked.");
}
@Override // Override the start method in the Application class
public void start(Stage primaryStage) {
System.out.println("start method is invoked.");
}
public static void main(String[] args) {
System.out.println("launch application.");
Application.launch(args);
}
}
A. launch application. Test constructor is invoked. start method is invoked.
B. Test constructor is invoked. start method is invoked.
C. launch application. start method is invoked. Test constructor is invoked.
D. start method is invoked. Test constructor is invoked.
E. launch application. start method is invoked.
Explanation / Answer
Answer for Question 1:
Ans: public DoubleProperty weightProperty() Option B
Answer for Question 2:
Ans: p.setLeft(node) Option A
Answer for Question 3:
Ans: B. pane.getChildren().remove(node); Option B
Answer for Question 4:
Ans: new Color(0.3, 0.5, 0.5, 0.1); Option E
Answer for Question 5:
Ans: Font.font("Times", 34); Option C
Answer for Question 6:
Ans: All Options except Option D.
Answer for Question 7:
Ans: B. button.setRotate(-45); C. button.setRotate(360 - 45);
Answer for Question 8:
Ans: D. pane.getChildren().addAll(node1, node2);
Answer for Question 9:
Ans: Except Option B all are right.
Answer for Question 10:
Ans: C. launch application. start method is invoked. Test constructor is invoked.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.