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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 8u40
    • 8u5, 8u20
    • javafx
    • 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.

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

              Created:
              Updated:
              Resolved:
              Imported: