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

Computer Science & Information Technology

You might also like to view...

What auditing tool is best used to monitor the changes in a cell over time?

A) Formula bar B) Watch Window C) Trace dependents D) Trace precedents

Computer Science & Information Technology

You can have only one double-colon notation within any IPv6 address

Indicate whether the statement is true or false

Computer Science & Information Technology