Java Code Examples for javafx.scene.text.Text#setOnMouseEntered()

The following examples show how to use javafx.scene.text.Text#setOnMouseEntered() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ThreadListCellFactory.java    From jstackfx with Apache License 2.0 5 votes vote down vote up
protected Text buildThreadLink(final TableCell<ThreadElement, Set<ThreadElement>> cell, final ThreadElement thread) {
    final Text threadText = new Text(thread.getName());
    threadText.getStyleClass().add("text");

    threadText.setOnMouseClicked(ThreadListCellFactory.this.buildMouseClickedEventHandler(cell, thread));
    threadText.setOnMouseEntered(event -> threadText.setCursor(Cursor.HAND));

    return threadText;
}
 
Example 2
Source File: HelpUtils.java    From pdfsam with GNU Affero General Public License v3.0 5 votes vote down vote up
private static Text helpIcon(HelpPopup popup) {
    Text icon = MaterialDesignIconFactory.get().createIcon(MaterialDesignIcon.HELP_CIRCLE, "1.1em");
    icon.setOnMouseEntered(e -> {
        Point2D p = icon.localToScreen(icon.getLayoutBounds().getMaxX(), icon.getLayoutBounds().getMaxY());
        popup.show(icon, p.getX(), p.getY());
    });
    icon.setOnMouseExited(e -> popup.hide());
    return icon;
}