本文整理了Java中javafx.scene.control.Tooltip.hide()
方法的一些代码示例,展示了Tooltip.hide()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tooltip.hide()
方法的具体详情如下:
包路径:javafx.scene.control.Tooltip
类名称:Tooltip
方法名:hide
暂无
代码示例来源:origin: torakiki/pdfsam
private ErrorTooltipManager(String message) {
require(isNotBlank(message), "Tooltip message cannot be blank");
this.tooltip = new Tooltip(message);
this.tooltip.getStyleClass().add(ERROR_TOOLTIP_CLASS);
hideTimer.getKeyFrames().add(new KeyFrame(new Duration(5000)));
hideTimer.setOnFinished(e -> {
tooltip.hide();
ErrorTooltipManager.this.active = false;
});
activationTimer.getKeyFrames().add(new KeyFrame(new Duration(250)));
activationTimer.setOnFinished(e -> {
if (!ErrorTooltipManager.this.active) {
Scene scene = getScene();
if (scene != null) {
Window owner = scene.getWindow();
if (owner != null && owner.isShowing() && ValidableTextField.this.isVisible()) {
Point2D where = getDisplayCoordiantes(owner, scene);
tooltip.show(ValidableTextField.this, where.getX(), where.getY());
ErrorTooltipManager.this.active = true;
hideTimer.playFromStart();
}
}
}
});
}
代码示例来源:origin: com.intuit.karate/karate-core
private void initTooltipMouseEvents() {
setOnMouseEntered(e -> {
if (customTooltip != null) {
Point2D p = localToScreen(getLayoutBounds().getMaxX(), getLayoutBounds().getMaxY());
customTooltip.show(this, p.getX(), p.getY());
}
});
setOnMouseExited(e -> {
if (customTooltip != null) {
customTooltip.hide();
}
});
}
代码示例来源:origin: com.dlsc.formsfx/formsfx-core
/**
* Sets the error message as tooltip for the matching control.
*
* @param below
* The control needed for positioning the tooltip.
* @param reference
* The control which gets the tooltip.
*/
protected void toggleTooltip(Node reference, Control below) {
String fieldTooltip = field.getTooltip();
if ((reference.isFocused() || reference.isHover()) && (!fieldTooltip.equals("") || field.getErrorMessages().size() > 0)) {
tooltip.setText((!fieldTooltip.equals("") ? fieldTooltip + "\n" : "") + String.join("\n", field.getErrorMessages()));
if (tooltip.isShowing()) {
return;
}
Point2D p = below.localToScene(0.0, 0.0);
tooltip.show(
getScene().getWindow(),
p.getX() + getScene().getX() + getScene().getWindow().getX(),
p.getY() + getScene().getY() + getScene().getWindow().getY() + below.getHeight() + 5
);
} else {
tooltip.hide();
}
}
内容来源于网络,如有侵权,请联系作者删除!