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

[ToolTip] Tooltip not showing text when wrapText enabled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 8u20
    • 8
    • javafx

      Run this sample

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.control.Tooltip;
      import javafx.scene.layout.HBox;
      import javafx.stage.Stage;

      public class HelloTooltip extends Application {
        
          public static void main(String[] args) {
              Application.launch(args);
          }

          @Override public void start(Stage stage) {
              Label label = new Label("Test");
              Tooltip tooltip = new Tooltip("1");
              tooltip.setWrapText(true);

              label.setTooltip(tooltip);

              HBox box = new HBox(label);
              Scene scene = new Scene(box);
              stage.setScene(scene);
              stage.show();
          }
      }

      Let your mouse on the Tooltip, you will see that the number one is not showing. If you deactivate the wrapText or you enter more that one character in the Tooltip, the problem is gone.

      Any idea?

      Work around right now is not to wrap the text when only one character is present.

            jgiles Jonathan Giles
            shadzic Samir Hadzic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: