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

[Stage] SetX, SetY works only after stage.show() but not before

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Cannot Reproduce
    • Affects Version/s: fx2.0
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Environment:

      Build45, Win7, JDK6.26

      Description

      If you call setX or setY before stage.show() then it doesn't make any influence. If you call after then it make.

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.TextField;
      import javafx.scene.layout.Pane;
      import javafx.stage.Stage;

      public class Main extends Application {
          public void start(Stage stage) {
              TextField text = new TextField();

              Pane pane = new Pane();
              pane.getChildren().addAll(text);

              stage.setX(1500); // comment me. this call doesn't make effect
              stage.setScene(new Scene(pane));
              stage.show();
              stage.setX(1500); //or comment me. this call makes effect
          }

          public static void main(String[] args) {
              Application.launch(Main.class, args);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kcr Kevin Rushforth
                Reporter:
                akirov Alexander Kirov (Inactive)
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: