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

[CSS] Setting Font Size for Tooltip is not applicable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u40
    • Fix Version/s: 8u60
    • Component/s: javafx
    • Environment:

      Java version: 1.8.0_40-ea
      JavaFX runtime version: 8.0.40-ea-b22

      Windows 8.1 x64

      Description

      Setting Font Size for Tooltip is not applicable.

      Compile and run this sample:

      package tooltiptest;

      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.Tooltip;
      import javafx.scene.layout.StackPane;
      import javafx.scene.text.Font;
      import javafx.stage.Stage;

      /**
       *
       * @author Ladislav Török local
       */
      public class TooltipTest extends Application {

          @Override
          public void start(Stage primaryStage) {
              String javaVersion = System.getProperty("java.version");
              String javafxRuntimeVersion = System.getProperty("javafx.runtime.version");
              System.out.println("Java version: " + javaVersion);
              System.out.println("JavaFX runtime version: " + javafxRuntimeVersion);
              
              Tooltip btnTooltip = new Tooltip();
              btnTooltip.setFont(new Font(70));
              btnTooltip.setText("Hello, World!");
              
              Button btn = new Button();
              btn.setText("Say 'Hello World'");
              btn.setTooltip(btnTooltip);
              btn.setOnAction((ActionEvent event) -> {
                  System.out.println("Hello, World!");
              });

              StackPane root = new StackPane();
              root.getChildren().add(btn);

              Scene scene = new Scene(root, 300, 250);

              primaryStage.setTitle("Hello World!");
              primaryStage.setScene(scene);
              primaryStage.show();
          }

          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              launch(args);
          }

      }

      See screenshots:
      javafx 8u40b22-ea - bad: http://i60.tinypic.com/30k52yw.png
      javafx 8u0b132 - good: http://i57.tinypic.com/2qdxyde.png (tooltip is trimmed, but it is ok, because screenshot is for application window)

      Note: when I using JavaFX 8.0 b132 - all is ok., other JavaFX platforms I don't have installed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jgiles Jonathan Giles
                Reporter:
                ltorokjfx Ladislav Török (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: