Я не знаю почему. Это мой код:
Код: Выделить всё
Tooltip.install(this, tooltip);
addEventHandler(MouseEvent.MOUSE_MOVED, mouseEvent -> {
// (render hexagon fills)
if (hexagon.isPresent()) { // if mouse if over a hexagon tile
hexagon.get().setFill(Color.ORANGE);
final Optional character = battle.getCharacterAt(hexagons.getKey(hexagon.get()));
if (character.isPresent()) {
tooltip.setText(String.format("%s (%d/%d)", character.get().getName(), character.get().getHealth(), character.get().getMaxHealth()));
}
else {
tooltip.hide();
}
}
});
Код: Выделить всё
package org.abos.twi.gatcha.gui;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class Gui extends Application {
@Override
public void start(Stage stage) throws Exception {
var pane = new BorderPane();
stage.setScene(new Scene(pane));
Tooltip.install(pane, new Tooltip("test"));
stage.show();
}
}

По всей видимости, эта проблема не возникает в ОС Windows.
Подробнее здесь: https://stackoverflow.com/questions/789 ... p-is-shown