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

[Popup] PopupWindow.show(Window): Wrong popup positioning on subsequent calls

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u20
    • 8u20
    • javafx
    • Windows 7 Pro SP1 x64, JDK8 build 129

      Code to reproduce the issue:

      package cz.zcu.fav.kiv.sparkle.gui.tools;

      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.stage.Popup;
      import javafx.stage.Stage;

      public class Test6 extends Application
      {
      public static void main(final String[] args)
      {
      launch(args);
      }

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

      final Button button = new Button("Click me");
      button.setOnAction(new EventHandler<ActionEvent>()
      {
      @Override
      public void handle(final ActionEvent event)
      {
      popup.show(primaryStage);
      }
      });

      final Button closeButton = new Button("Close");
      closeButton.setOnAction(new EventHandler<ActionEvent>()
      {
      @Override
      public void handle(final ActionEvent event)
      {
      popup.hide();
      }
      });

      popup.getContent().add(closeButton);

      primaryStage.setScene(new Scene(button));
      primaryStage.show();
      }
      }

      1. Click the "Click me" button. Another button appears.
      2. Click the "Close" button. It disappears.
      3. Repeat the previous two steps to see the issue.

      The popup window gets positioned as if it was an ordinary window (that means left screen corner with variable offset on each attempt).

            msladecek Martin Sládeček
            jsmucrjfx Jan Smucr (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: