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

After initing the modality of a non-primary stage to MODAL, closing that stage causes the primary stage to become non-resizable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8u74, 9
    • javafx

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


      ADDITIONAL OS VERSION INFORMATION :
      Linux mega 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      When a second Stage is created, and initModality is used to make it WINDOW_MODAL or APPLICATION_MODAL, the primary stage will become non-resizable after the second Stage is closed (using close button).

      This bug does not happen on Windows. It seems closely related to JDK-8140491.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the code below. 2 windows will appear : one saying "Primary Stage", one "Secondary Stage".

      At this point, both windows are resizable.
      Close the "Secondary Stage" window using the close button in the corner.

      At this point, the Primary Stage window switches to no longer being resizable.



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Normally, the primary stage should not be affected.
      ACTUAL -
      The primary stage is no longer resizable after closing the dialog. When observed closely, it seems that some other stylistic changes are applied when the secondary stage is closed.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.layout.VBox;
      import javafx.stage.Modality;
      import javafx.stage.Stage;

      public class Test extends Application {

        public static void main(String[] args) {

          Application.launch("xDB CSI");
        }

        @Override
        public void start(Stage primaryStage) throws Exception {

          VBox root = new VBox();
          root.getChildren().add(new Label("Primary Stage"));
          Scene scene = new Scene(root);

          primaryStage.setScene(scene);

          primaryStage.setHeight(200);
          primaryStage.setWidth(200);
          primaryStage.setResizable(true);

          primaryStage.show();

          Stage secondStage = new Stage();

          VBox secondRoot = new VBox();
          secondRoot.getChildren().add(new Label("Secondary Stage"));
          Scene secondScene = new Scene(secondRoot);

          secondStage.setScene(secondScene);

          secondStage.setHeight(100);
          secondStage.setWidth(100);

          secondStage.initModality(Modality.APPLICATION_MODAL);

          secondStage.show();
        }
      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      None so far.

            ssadetsky Semyon Sadetsky (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: