javax.swing.JComboBox.getPrototypeDisplayValue()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(173)

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

JComboBox.getPrototypeDisplayValue介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javafx2-project

public Object getPrototypeDisplayValue() {
  return combo.getPrototypeDisplayValue();
}

代码示例来源:origin: stackoverflow.com

popupList.setPrototypeCellValue(box.getPrototypeDisplayValue());

代码示例来源:origin: net.sf.tinylaf/tinylaf

Object prototypeValue = comboBox.getPrototypeDisplayValue();
if(prototypeValue != null)  {

代码示例来源:origin: net.java.dev.swing-layout/swing-layout

private static int getComboBoxBaselineResizeBehavior(JComboBox cb) {
  if (cb.isEditable()) {
    return getBaselineResizeBehavior(cb.getEditor().getEditorComponent());
  }
  ListCellRenderer renderer = cb.getRenderer();
  if (renderer == null) {
    if (brbListCellRenderer == null) {
      brbListCellRenderer = new DefaultListCellRenderer();
    }
    renderer = brbListCellRenderer;
  }
  Object value = null;
  Object prototypeValue = cb.getPrototypeDisplayValue();
  if (prototypeValue != null)  {
    value = prototypeValue;
  } else if (cb.getModel().getSize() > 0) {
    value = cb.getModel().getElementAt(0);
  }
  if (value != null) {
    if (brbList == null) {
      brbList = new JList();
    }
    Component component = renderer.
        getListCellRendererComponent(brbList, value, -1,
        false, false);
    return getBaselineResizeBehavior(component);
  }
  return BRB_OTHER;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

Object prototypeValue= comboBox.getPrototypeDisplayValue();
if (prototypeValue != null)

代码示例来源:origin: org.java.net.substance/substance

private void updateComboBoxBorder() {
  Border b = this.comboBox.getBorder();
  if (b == null || b instanceof UIResource) {
    int comboFontSize = SubstanceSizeUtils
        .getComponentFontSize(this.comboBox);
    Insets comboBorderInsets = SubstanceSizeUtils
        .getComboBorderInsets(comboFontSize);
    if (this.comboBox.isEditable()) {
      this.comboBox.setBorder(new SubstanceTextComponentBorder(
          comboBorderInsets));
    } else {
      this.comboBox
          .setBorder(new BorderUIResource.EmptyBorderUIResource(
              comboBorderInsets));
      // BasicComboBoxUI does not invalidate display size when
      // combo becomes uneditable. However, this is not good
      // in Substance which has different preferred size for
      // editable and uneditable combos. Calling the method below
      // will trigger the path in BasicComboBoxUI.Handler that
      // will invalidate the cached sizes.
      this.comboBox.setPrototypeDisplayValue(this.comboBox
          .getPrototypeDisplayValue());
    }
    this.layoutInsets = SubstanceSizeUtils
        .getComboLayoutInsets(comboFontSize);
  } else {
    this.layoutInsets = new Insets(0, 0, 0, 0);
  }
}

代码示例来源:origin: com.github.insubstantial/substance

private void updateComboBoxBorder() {
  Border b = this.comboBox.getBorder();
  if (b == null || b instanceof UIResource) {
    int comboFontSize = SubstanceSizeUtils
        .getComponentFontSize(this.comboBox);
    Insets comboBorderInsets = SubstanceSizeUtils
        .getComboBorderInsets(comboFontSize);
    if (this.comboBox.isEditable()) {
      this.comboBox.setBorder(new SubstanceTextComponentBorder(
          comboBorderInsets));
    } else {
      this.comboBox
          .setBorder(new BorderUIResource.EmptyBorderUIResource(
              comboBorderInsets));
      // BasicComboBoxUI does not invalidate display size when
      // combo becomes uneditable. However, this is not good
      // in Substance which has different preferred size for
      // editable and uneditable combos. Calling the method below
      // will trigger the path in BasicComboBoxUI.Handler that
      // will invalidate the cached sizes.
      this.comboBox.setPrototypeDisplayValue(this.comboBox
          .getPrototypeDisplayValue());
    }
    this.layoutInsets = SubstanceSizeUtils
        .getComboLayoutInsets(comboFontSize);
  } else {
    this.layoutInsets = new Insets(0, 0, 0, 0);
  }
}

相关文章

JComboBox类方法