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

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

    Details

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

      Windows 7 64 bit
      NVIDIA GeForce 210

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              kcr Kevin Rushforth
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: