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...
The text that appears in every version of a merged document is often called boilerplate text.
Answer the following statement true (T) or false (F)
Your supervisor said that “Integration testing is a waste of time. If each program is tested adequately, integration testing isn’t needed. Instead, we should move on to system testing as soon as possible. If modules don’t interact properly, we’ll handle it then.” Do you agree or disagree with this comment? Explain your answer.
What will be an ideal response?