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

[Popup] application hang, if you create popup with itself as a parent.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 7u6
    • 7u6
    • javafx
    • 2.2.0b08. Win7, Linux12. X64 x32.

      Run code, press button:


      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.event.EventHandler;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.StackPane;
      import javafx.scene.layout.VBox;
      import javafx.scene.paint.Color;
      import javafx.scene.shape.Ellipse;
      import javafx.scene.text.Text;
      import javafx.stage.Popup;
      import javafx.stage.Stage;

      public class MenuButtonApp extends Application {

          private Popup p1;
          private Button parentButton;

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

          @Override
          public void start(final Stage stage) throws Exception {
              p1 = new Popup();

              parentButton = new Button("Parent");
              parentButton.setOnAction(new EventHandler<ActionEvent>() {

                  @Override
                  public void handle(ActionEvent t) {
                      p1.show(p1, 100, 100);
                  }
              });

              p1.setAutoFix(true);
              p1.setAutoHide(false);

              StackPane stack = new StackPane();
              Ellipse ellipse = new Ellipse(70.0F, 50.0F);
              ellipse.setFill(Color.AQUAMARINE);
              stack.getChildren().clear();
              stack.getChildren().addAll(ellipse, new Text("Popup!!"));
              p1.getContent().clear();
              p1.getContent().addAll(stack);

              Scene scene = new Scene(new Group(), 300, 300);
              VBox vbox = new VBox(5.0F);
              vbox.getChildren().clear();
              vbox.getChildren().addAll(parentButton);
              ((Group) scene.getRoot()).getChildren().clear();
              ((Group) scene.getRoot()).getChildren().addAll(vbox);
              stage.setScene(scene);
              stage.show();
          }
      }

            lnerad Ľubomír Nerád (Inactive)
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: