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

XMLWordPrintable

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

      Build45, Win7, JDK6.26

      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);
          }
      }

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

              Created:
              Updated:
              Resolved:
              Imported: