Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8179514

[macosx] Maximize button is enabled for non-resizable parent window when child window is opened

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.8.0_131"
      Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
      Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Mac OSX Yosemite 10.10.5 - macOS Sierra 10.12.4

      A DESCRIPTION OF THE PROBLEM :
      When setting the resizable = false in the parent window, the maximize button should keep the disabled state, but it will be changed illegally when the child window is opened.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Execute the test program
      2. Open and close the dialog

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      maximize button should keep the disabled state
      ACTUAL -
      Maximize button is enabled

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.geometry.Insets;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.ButtonType;
      import javafx.scene.control.Dialog;
      import javafx.scene.control.Label;
      import javafx.scene.control.Alert;
      import javafx.scene.control.Alert.AlertType;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class NotResizableWindowTest extends Application{

      @Override
      public void start(Stage primaryStage) throws Exception {
      Button openDialog = new Button("Open Dialog");
      Button openAlert = new Button("Open Alert");
      Button openDialog2 = new Button("Open Dialog(temporary solution)");

      openDialog.setOnAction((e)->{
      Dialog<ButtonType> dialog = new Dialog<>();
      dialog.initOwner(primaryStage);
      dialog.setContentText("Hello");
      dialog.getDialogPane().getButtonTypes().add(ButtonType.CLOSE);
      dialog.show();
      });
      openDialog2.setOnAction((e)->{
      Dialog<ButtonType> dialog = new Dialog<>();
      dialog.initOwner(primaryStage);
      dialog.setContentText("Hello");
      dialog.getDialogPane().getButtonTypes().add(ButtonType.CLOSE);
      dialog.setOnHidden((event)->{
      // temp solution
      primaryStage.setResizable(true);
      primaryStage.setResizable(false);
      });
      dialog.show();
      });
      openAlert.setOnAction((e)->{
      Alert alert = new Alert(AlertType.INFORMATION);
      alert.initOwner(primaryStage);
      alert.setContentText("Hello");
      alert.show();
      });

      VBox root = new VBox(8, new Label(""), openDialog, openDialog2, openAlert);
      root.setPadding(new Insets(8));
      Scene scene = new Scene(root);
      primaryStage.setScene(scene);
      primaryStage.setResizable(false);
      primaryStage.show();
      }


      public static void main(String[] args) {
      Application.launch(args);
      }


      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :


      primaryStage.setResizable(true);
      primaryStage.setResizable(false);



            aniyogi Avik Niyogi (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: