area.setMouseOverTextDelay(Duration.ofSeconds(1));
area.addEventHandler(MouseOverTextEvent.MOUSE_OVER_TEXT_BEGIN, e -> {
int chIdx = e.getCharacterIndex();
Point2D pos = e.getScreenPosition();
popupMsg.setText("Character '" + area.getText(chIdx, chIdx+1) + "' at " + pos);
popup.show(area, pos.getX(), pos.getY() + 10);
});
area.addEventHandler(MouseOverTextEvent.MOUSE_OVER_TEXT_END, e -> {
popup.hide();
});