С кнопкой закрыть все понятно, а как быть с кнопками свернуть/развернуть?
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class Q extends Application {
@Override
public void start(Stage primaryStage) {
VBox root = new VBox(5);
root.setPadding(new javafx.geometry.Insets(55));
//не останавливать приложение
Platform.setImplicitExit(false);
TextField textField = new TextField();
Button button = new Button("Yes");
root.getChildren().addAll(textField, button);
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
primaryStage.setOnCloseRequest(event -> System.out.println("Нажат крестик"));
}
public static void main(String[] args) {
launch(args);
}
}