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

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

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

JComboBox.getBorder介绍

暂无

代码示例

代码示例来源:origin: com.jtattoo/JTattoo

public void focusGained(FocusEvent e) {
  if (comboBox != null) {
    orgBorder = comboBox.getBorder();
    orgBackgroundColor = comboBox.getBackground();
    LookAndFeel laf = UIManager.getLookAndFeel();
    if (laf instanceof AbstractLookAndFeel) {
      if (orgBorder instanceof UIResource) {
        Border focusBorder = ((AbstractLookAndFeel)laf).getBorderFactory().getFocusFrameBorder();
        comboBox.setBorder(focusBorder);
      }
      Color backgroundColor = AbstractLookAndFeel.getTheme().getFocusBackgroundColor();
      comboBox.setBackground(backgroundColor);
    }
  }
}

代码示例来源:origin: com.github.tntim96/rhino

context.setLightWeightPopupEnabled(false);
toolTips = Collections.synchronizedList(new java.util.ArrayList<String>());
label.setBorder(context.getBorder());
context.addActionListener(this);
context.setActionCommand("ContextSwitch");

代码示例来源:origin: com.github.houbie/rhino-mod

context.setLightWeightPopupEnabled(false);
toolTips = Collections.synchronizedList(new java.util.ArrayList<String>());
label.setBorder(context.getBorder());
context.addActionListener(this);
context.setActionCommand("ContextSwitch");

代码示例来源:origin: ro.isdc.wro4j/rhino

context.setLightWeightPopupEnabled(false);
toolTips = Collections.synchronizedList(new java.util.ArrayList<String>());
label.setBorder(context.getBorder());
context.addActionListener(this);
context.setActionCommand("ContextSwitch");

代码示例来源:origin: org.jvnet.hudson/embedded-rhino-debugger

context.setLightWeightPopupEnabled(false);
toolTips = Collections.synchronizedList(new java.util.ArrayList<String>());
label.setBorder(context.getBorder());
context.addActionListener(this);
context.setActionCommand("ContextSwitch");

代码示例来源: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类方法