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

Provide a way to position stage depending on its size before actually showing it on the screen

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 8
    • javafx
    • Windows 7 x64, 8.0-graphics-scrum-b1007-x64

      for the following sequence (attached):

              stage.sizeToScene();
              System.out.println(String.format("before: %.0fx%.0f", stage.getWidth(), stage.getHeight()));
              stage.show();
              System.out.println(String.format("after: %.0fx%.0f", stage.getWidth(), stage.getHeight()));

      I get the following output:

      before: NaNxNaN
      after: 216x238

      I need to know stage size before I actually show it to position it correctly. Although it can be achieved by listening to width and height properties, this seems to be overkill for such a simple task.

            Unassigned Unassigned
            mrkam Alexander Kuznetcov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported: