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

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

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

JComboBox.getComponentCount介绍

暂无

代码示例

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15

/**
 * A convenience method to search through the given JComboBox for the
 * JButton which toggles the popup up open and closed.
 */
private static JButton findArrowButton(JComboBox c) {
  for (int i = 0, n = c.getComponentCount(); i < n; i++) {
    final Component comp = c.getComponent(i);
    if (comp instanceof JButton)
      return (JButton) comp;
  }
  return null;
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16

/**
 * A convenience method to search through the given JComboBox for the
 * JButton which toggles the popup up open and closed.
 */
private static JButton findArrowButton(JComboBox c) {
  for (int i = 0, n = c.getComponentCount(); i < n; i++) {
    final Component comp = c.getComponent(i);
    if (comp instanceof JButton)
      return (JButton) comp;
  }
  return null;
}

代码示例来源:origin: com.haulmont.thirdparty/glazedlists

/**
 * A convenience method to search through the given JComboBox for the
 * JButton which toggles the popup up open and closed.
 */
private static JButton findArrowButton(JComboBox c) {
  for (int i = 0, n = c.getComponentCount(); i < n; i++) {
    final Component comp = c.getComponent(i);
    if (comp instanceof JButton)
      return (JButton) comp;
  }
  return null;
}

代码示例来源:origin: net.anwiba.commons/anwiba-commons-swing-core

public static JButton getComboBoxButton(final JComboBox<?> comboBox) {
 for (int i = 0; i < comboBox.getComponentCount(); i++) {
  final Component comboBoxComponent = comboBox.getComponent(i);
  if (comboBoxComponent == null) {
   continue;
  }
  if (comboBoxComponent instanceof JButton) {
   return (JButton) comboBoxComponent;
  }
 }
 throw new UnreachableCodeReachedException();
}

相关文章

JComboBox类方法