本文整理汇总了Java中javafx.scene.control.Label.setTooltip方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setTooltip方法的具体用法?Java Label.setTooltip怎么用?Java Label.setTooltip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.Label
的用法示例。
在下文中一共展示了Label.setTooltip方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GoogleEntryAttendeeItem
import javafx.scene.control.Label; //导入方法依赖的package包/类
public GoogleEntryAttendeeItem(EventAttendee attendee) {
this.attendee = Objects.requireNonNull(attendee);
optionalIcon = new Label();
optionalIcon.setOnMouseClicked(evt -> setOptional(!isOptional()));
optionalIcon.getStyleClass().add("button-icon");
optionalIcon.setTooltip(new Tooltip());
statusIcon = new Label();
name = new Label();
name.setMaxWidth(Double.MAX_VALUE);
setOptional(Boolean.TRUE.equals(attendee.getOptional()));
optionalProperty().addListener(obs -> updateIcon());
updateIcon();
removeButton = new Label();
removeButton.setGraphic(new FontAwesome().create(FontAwesome.Glyph.TRASH_ALT));
removeButton.getStyleClass().add("button-icon");
removeButton.setOnMouseClicked(evt -> removeAttendee(attendee));
HBox.setHgrow(optionalIcon, Priority.NEVER);
HBox.setHgrow(name, Priority.ALWAYS);
HBox.setHgrow(removeButton, Priority.NEVER);
getStyleClass().add("attendee-item");
getChildren().addAll(optionalIcon, statusIcon, name, removeButton);
ContextMenu menu = new ContextMenu();
MenuItem optionalItem = new MenuItem("Mark as optional");
optionalItem.setOnAction(evt -> setOptional(true));
MenuItem requiredItem = new MenuItem("Mark as required");
requiredItem.setOnAction(evt -> setOptional(false));
MenuItem removeItem = new MenuItem("Remove attendee");
removeItem.setOnAction(evt -> removeAttendee(attendee));
menu.getItems().addAll(optionalItem, requiredItem, new SeparatorMenuItem(), removeItem);
addEventHandler(CONTEXT_MENU_REQUESTED, evt -> menu.show(this, evt.getScreenX(), evt.getScreenY()));
}
示例2: DefaultPowerMizerModeTweak
import javafx.scene.control.Label; //导入方法依赖的package包/类
public DefaultPowerMizerModeTweak()
{
super();
Label label = new Label("Default startup PowerMizer mode: ");
label.setTooltip(new Tooltip("Sets the default PowerMizer mode the application will automatically switch to on startup. Default is Driver Controlled(Auto)"));
super.addLeftComponent(label);
}
示例3: setLineIcon
import javafx.scene.control.Label; //导入方法依赖的package包/类
private void setLineIcon(int i, FilteredList<SyntaxError> syntaxErrors, Label icon) {
icon.setVisible(syntaxErrors.size() != 0);
String combinedMessages = syntaxErrors.stream()
.map(SyntaxError::getMessage)
.reduce("", (s, s2) -> s + s2);
icon.setTooltip(new Tooltip(combinedMessages));
}
示例4: ResetOverclocksTweak
import javafx.scene.control.Label; //导入方法依赖的package包/类
public ResetOverclocksTweak()
{
super();
Label label = new Label("Reset overclocks on close. ");
label.setTooltip(new Tooltip("On close, resets all overclocking offsets except power limit to 0."));
Button button = new Button();
button.setOnMouseClicked(new ResetButtonHandler());
super.addLeftComponent(label);
}