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

[Modality] Exception, when closing stages in hierarchies with NONE modality

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.0.2
    • Fix Version/s: fx2.1
    • Component/s: javafx
    • Labels:
    • Environment:

      MacOSX 10.6.8 2.0.2b06; Win7 2.0.2b06

      Description

      Launching next application on Win7 2.0.2b06


      package testproject;

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.HBox;
      import javafx.stage.Modality;
      import javafx.stage.Stage;

      /**
       * @author Alexander Kirov
       */
      public class Main3 extends Application{

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

          @Override
          public void start(Stage stage) throws Exception {
              Button button = new Button("Some button");
              HBox hb = new HBox();
              hb.getChildren().add(button);

              Button button1 = new Button("Some button 2");
              HBox hb1 = new HBox();
              hb1.getChildren().add(button1);

              Scene scene = new Scene (hb, 300, 300);
              stage.setScene(scene);
              stage.show();

              Stage someStage = new Stage();
              Scene oneMoreScene = new Scene(hb1, 300, 300);
              someStage.setScene(oneMoreScene);
              
              someStage.initModality(Modality.NONE);
              someStage.initOwner(stage);
              someStage.show();
              Thread.sleep(5000);
              stage.close();
              System.out.println("Boom");
              someStage.close();
          }
      }

      Gives as result of execution:

      run:
      Boom
      BUILD SUCCESSFUL (total time: 5 seconds)

      If launch the same code on MacOSX 10.6.8 2..0.2b06 I can get an exception as written in comments:

        Attachments

          Activity

            People

            • Assignee:
              morris Morris Meyer (Inactive)
              Reporter:
              akirov Alexander Kirov (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: