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.
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.