Suppose the following program displays a pane in the stage. What is the output if the user presses the key for letter K?
// import javafx classes omitted
public class Test extends Application {
@Override
public void start(Stage primaryStage) {
| // Code to create and display pane omitted |
| pane.setOnKeyPressed(e -> |
| System.out.print("Key pressed " + e.getCode() + " ")); |
| System.out.println("Key typed " + e.getCode())); |
}
}
◦ Key pressed B
◦ Key typed UNDEFINED
◦ Key pressed B Key typed
◦ Key pressed B Key typed UNDEFINED