Source:
<code>public void setUpWindow() { MenuBar menuBar = new MenuBar(this); BorderPane pane = new BorderPane(); Scene scene = new PlayOnLinuxScene(pane, 780, 400); VBox topContainer = new VBox(); toolBar = new ToolBar(this); topContainer.getChildren().add(menuBar); topContainer.getChildren().add(toolBar); pane.setTop(topContainer); statusBar = new StatusBar(this, scene); pane.setBottom(statusBar); GridPane mainContent = new GridPane(); ColumnConstraints columnConstraint = new ColumnConstraints(); columnConstraint.setPercentWidth(30); ColumnConstraints columnConstraint2 = new ColumnConstraints(); columnConstraint2.setPercentWidth(70); RowConstraints rowConstraint = new RowConstraints(); rowConstraint.setPercentHeight(100); mainContent.getColumnConstraints().add(columnConstraint); mainContent.getColumnConstraints().add(columnConstraint2); mainContent.getRowConstraints().add(rowConstraint); mainContent.setVgap(2.0); mainContent.add(new MenuLeft(), 0, 0); this.applicationListWidget = new ApplicationListWidget(); mainContent.add(applicationListWidget, 1, 0); pane.setCenter(mainContent); this.setScene(scene); this.setTitle(translate("${application.name}")); this.show(); <START> scene.getWindow().setOnCloseRequest(new EventHandler<WindowEvent>() { <END> @Override public void handle(WindowEvent event) { Alert alert = new Alert(Alert.AlertType.CONFIRMATION); alert.setTitle(translate("Would you like to exit?")); alert.setHeaderText(translate("Are You Sure?")); Optional<ButtonType> result = alert.showAndWait(); if (result.get() == ButtonType.OK){ Platform.exit(); } else { event.consume(); } } }); }</code><technical_language>a lambda expression instead please</technical_language>

Target:
public void setUpWindow() { MenuBar menuBar = new MenuBar(this); BorderPane pane = new BorderPane(); Scene scene = new PlayOnLinuxScene(pane, 780, 400); VBox topContainer = new VBox(); toolBar = new ToolBar(this); topContainer.getChildren().add(menuBar); topContainer.getChildren().add(toolBar); pane.setTop(topContainer); statusBar = new StatusBar(this, scene); pane.setBottom(statusBar); GridPane mainContent = new GridPane(); ColumnConstraints columnConstraint = new ColumnConstraints(); columnConstraint.setPercentWidth(30); ColumnConstraints columnConstraint2 = new ColumnConstraints(); columnConstraint2.setPercentWidth(70); RowConstraints rowConstraint = new RowConstraints(); rowConstraint.setPercentHeight(100); mainContent.getColumnConstraints().add(columnConstraint); mainContent.getColumnConstraints().add(columnConstraint2); mainContent.getRowConstraints().add(rowConstraint); mainContent.setVgap(2.0); mainContent.add(new MenuLeft(), 0, 0); this.applicationListWidget = new ApplicationListWidget(); mainContent.add(applicationListWidget, 1, 0); pane.setCenter(mainContent); this.setScene(scene); this.setTitle(translate("${application.name}")); this.show(); scene.getWindow().setOnCloseRequest(event -> { Alert alert = new Alert(Alert.AlertType.CONFIRMATION); alert.setTitle(translate("${application.name}")); alert.setHeaderText(translate("Are you sure you want to close all ${application.name} windows?")); Optional<ButtonType> result = alert.showAndWait(); if (result.get() == ButtonType.OK){ Platform.exit(); } else { event.consume(); } }); }