Fill in the code to display the key pressed in the text.

```
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.text.Text;
import javafx.stage.Stage;

public class Test extends Application {
@Override // Override the start method in the Application class
public void start(Stage primaryStage) {
Pane pane = new Pane();
Text text = new Text(20, 20, "Welcome");
pane.getChildren().add(text);
Scene scene = new Scene(pane, 200, 250);
primaryStage.setTitle("Test"); // Set the stage title
primaryStage.setScene(scene); // Place the scene in the stage
primaryStage.show(); // Display the stage

text.setFocusTraversable(true);
text.setOnKeyPressed(_______________________);
}

/**
* 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. () -> text.setText(e.getText())
b. (e) -> text.setText(e.getText())
c. e -> text.setText(e.getText())
d. e -> {text.setText(e.getText());}
```


```
b. (e) -> text.setText(e.getText())
c. e -> text.setText(e.getText())
d. e -> {text.setText(e.getText());}
```

Computer Science & Information Technology

You might also like to view...

Adobe Creative Cloud works equally well with Windows and macOS workstations.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

As a rule, the color used in toys for girls is usually comprised of _____________.

a. deep, dark colors of blue and violet b. bright, saturated hues of blue and red c. neutrals and shades d. soft, warm hues and pastels

Computer Science & Information Technology

The customer's name and address and the number of the sales rep who represents the customer are stored with sales rep information.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

The ___________________ Editor is used to create and edit methods.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology