javafx.scene.control.Label.setPrefHeight()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中javafx.scene.control.Label.setPrefHeight()方法的一些代码示例,展示了Label.setPrefHeight()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.setPrefHeight()方法的具体详情如下:
包路径:javafx.scene.control.Label
类名称:Label
方法名:setPrefHeight

Label.setPrefHeight介绍

暂无

代码示例

代码示例来源:origin: pmd/pmd

private void showAutocompletePopup(int insertionIndex, String input) {
  CompletionResultSource suggestionMaker = mySuggestionProvider.get();
  List<MenuItem> suggestions =
    suggestionMaker.getSortedMatches(input, 5)
            .map(result -> {
              Label entryLabel = new Label();
              entryLabel.setGraphic(result.getTextFlow());
              entryLabel.setPrefHeight(5);
              CustomMenuItem item = new CustomMenuItem(entryLabel, true);
              item.setUserData(result);
              item.setOnAction(e -> applySuggestion(insertionIndex, input, result.getNodeName()));
              return item;
            })
            .collect(Collectors.toList());
  autoCompletePopup.getItems().setAll(suggestions);
  myCodeArea.getCharacterBoundsOnScreen(insertionIndex, insertionIndex + input.length())
       .ifPresent(bounds -> autoCompletePopup.show(myCodeArea, bounds.getMinX(), bounds.getMaxY()));
  Skin<?> skin = autoCompletePopup.getSkin();
  if (skin != null) {
    Node fstItem = skin.getNode().lookup(".menu-item");
    if (fstItem != null) {
      fstItem.requestFocus();
    }
  }
}

代码示例来源:origin: com.dlsc.formsfx/formsfx-core

/**
 * {@inheritDoc}
 */
@Override
public void setupValueChangedListeners() {
  super.setupValueChangedListeners();
  field.multilineProperty().addListener((observable, oldValue, newValue) -> {
    stack.setPrefHeight(newValue ? 80 : 0);
    readOnlyLabel.setPrefHeight(newValue ? 80 : 26);
  });
  field.errorMessagesProperty().addListener((observable, oldValue, newValue) -> toggleTooltip(field.isMultiline() ? editableArea : editableField));
  editableField.focusedProperty().addListener((observable, oldValue, newValue) -> toggleTooltip(editableField));
  editableArea.focusedProperty().addListener((observable, oldValue, newValue) -> toggleTooltip(editableArea));
}

代码示例来源:origin: com.dlsc.formsfx/formsfx-core

readOnlyLabel.setPrefHeight(26);
  readOnlyLabel.setPrefHeight(80);

代码示例来源:origin: com.dlsc.formsfx/formsfx-core

readOnlyLabel.setPrefHeight(26);

相关文章