Latest Version Already Passed
What is JavaFX primarily used for?
A) Developing web applications
B) Writing server-side code
✔✔C) Creating graphical user interfaces
D) Managing databases
Which JavaFX class serves as the foundation for all JavaFX applications?
A) Frame
B) Component
✔✔C) Application
D) Scene
What is the role of the Stage class in JavaFX?
A) It represents a graphical button
B) It manages the layout of UI elements
✔✔C) It represents the top-level container for a JavaFX application
1
,D) It handles animations
Which class in JavaFX is used to define the UI structure?
A) View
B) Pane
✔✔C) Scene
D) Window
Which JavaFX container organizes elements in a horizontal row?
A) VBox
✔✔B) HBox
C) GridPane
D) StackPane
Which method is overridden when creating a JavaFX application?
A) startApp()
B) launch()
✔✔C) start()
2
,D) run()
How do you launch a JavaFX application?
✔✔A) By calling Application.launch()
B) By calling main() directly
C) By creating an instance of Scene
D) By using a JFrame
Which JavaFX layout arranges UI components in a grid?
A) BorderPane
B) HBox
C) FlowPane
✔✔D) GridPane
Which JavaFX node is used to display images?
A) ImagePane
✔✔B) ImageView
C) PictureFrame
3
, D) PictureBox
How do you create a button in JavaFX?
✔✔A) new Button("Click Me")
B) new JButton("Click Me")
C) new UIElement("Click Me")
D) new Clickable()
Which JavaFX class is used for drawing shapes like circles and rectangles?
A) Canvas2D
✔✔B) Shape
C) GraphicsPane
D) ImageShape
What is the purpose of setOnAction() in JavaFX?
✔✔A) It defines an event handler for a button click
B) It changes the text of a button
C) It resizes the window
4