Stage.sizeToScene scales content if the scene size is too small

XMLWordPrintable

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: P4
    • 8u40
    • Affects Version/s: 8u5, 8u20
    • Component/s: javafx
    • Environment:

      Windows 7 64 bit
      NVIDIA GeForce 210

      SSCE:

      import javafx.application.Application;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.Tooltip;
      import javafx.stage.Stage;

      public class DisabledTooltips extends Application
      {

        @Override
        public void start( final Stage primaryStage )
        {
          final Button btn = new Button( "Hit me!" );
          final Tooltip tip = new Tooltip( "I am informative!" );
          btn.setTooltip( tip );
          primaryStage.setScene( new Scene( new Group( btn ) ) );
          primaryStage.sizeToScene();
          primaryStage.show();
        }

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

      The button gets scaled up to the Scene size. Furthermore the scaled image is of bad quality and the hit area of the button is still as if not scaled (can be verified by trying to trigger the tooltip). Upon Stage resize, the button gets resized to its preferred size.

            Assignee:
            Kevin Rushforth
            Reporter:
            J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: