Supose the follwoing program displays a pane in the stage. What is the output if the user presses the DOWN arrow key?
```
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
// import javafx classes omitted
public class Test1 extends Application {
@Override
public void start(Stage primaryStage) {
// Code to create and display pane omitted
Pane pane = new Pane();
Scene scene = new Scene(pane, 200, 250);
primaryStage.setTitle("MyJavaFX"); // Set the stage title
primaryStage.setScene(scene); // Place the scene in the stage
primaryStage.show(); // Display the stage
pane.requestFocus();
pane.setOnKeyPressed(e ->
System.out.print("Key pressed " + e.getCode() + " "));
pane.setOnKeyTyped(e ->
System.out.println("Key typed " + e.getCode()));
}
/**
* The main method is only needed for the IDE with limited
* JavaFX support. Not needed for running from the command line.
*/
public static void main(String[] args) {
launch(args);
}
}
```
a. Key pressed DOWN Key typed UNDEFINED
b. Key pressed DOWN Key typed
c. Key typed UNDEFINED
d. Key pressed DOWN
d. Key pressed DOWN
You might also like to view...
Animations control how slides come onto the screen
Indicate whether the statement is true or false
The value of a relational expression such as hours > 40 depends on the ____ stored in the variable hours.
A. condition B. sign C. value D. relationship
Describe how PowerPivot can be used to create a simple dashboard and discuss a few simple ways to enhance the value of a dashboard
What will be an ideal response?
In VBA, the ________ structure uses the keywords While or Until
A) If...Then B) For...Next C) If...Then...Else D) Do...Loop