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

Unable to create popup

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      Lenovo ThinkCenter i7/ JavaFX 14 / Windows 10

      A DESCRIPTION OF THE PROBLEM :
      This bug was reported fixed for 8, but it can be reproduced (using the text-case in the bug report) in version 14.




      REGRESSION : Last worked in version 8

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Take the testcase from Bug JDK-8119136 and run it. Test case is copied and pasted from original bug report for convenience.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The bug does not reproduce.
      ACTUAL -
      The bug is reproduced

      ---------- BEGIN SOURCE ----------
      public class StageTest extends Application {
      Test test = new Test();
      boolean b = true;
      int i = 0;
      int j = 0;

      public void start(Stage stage) {
      test.init();
      Group root = new Group();
      Scene scene = new Scene(root, 100, 100);
      Button btn = new Button("Show");
      btn.setMinSize(100, 100);
      btn.setOnAction(new EventHandler<ActionEvent>() {
      public void handle(ActionEvent arg0) {
      try {
      while (true) {
      // show and count
      i++;
      test.show();
      Thread.sleep(100);

      // hide and count
      j++;
      test.hide();
      Thread.sleep(100);
      i++;

      // console
      System.out.println("Work fine, show count=" + i + ", hide count=" + j);
      }
      } catch (Exception e) {
      // exception, about 15610 times
      // java.lang.RuntimeException: could not create platform window
      System.out.println("Exception, show count=" + i + ", hide count=" + j);
      e.printStackTrace();
      }
      }
      });
      root.getChildren().add(btn);
      stage.setScene(scene);
      stage.show();
      }

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

      public class Test {

      Stage stage;
      Scene scene;
      AnchorPane anchorpane;

      public void init() {
      anchorpane = new AnchorPane();
      stage = new Stage();
      Scene scene = new Scene(anchorpane, 655, 354);
      stage.setTitle("Stage Test");
      stage.setResizable(false);
      stage.setScene(scene);
      }

      public void show() {
      AnchorPane ap = new AnchorPane();
      anchorpane.getChildren().add(ap);
      stage.show();
      }

      public void hide() {

      ((AnchorPane) anchorpane.getChildren().get(0)).getChildren()
      .clear();
      anchorpane.getChildren().clear();
      stage.hide();
      }
      }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: