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

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

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

JComboBox.getComponent介绍

暂无

代码示例

代码示例来源: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: stackoverflow.com

public static class MockCombo extends JLabel {

  private JButton arrow;

  public MockCombo() {
    JComboBox box = new JComboBox();
    box.setEditable(true);
    arrow = (JButton) box.getComponent(0);
    setLayout(new BorderLayout());
    add(arrow, BorderLayout.LINE_END);
    setOpaque(true);
  }

}

代码示例来源: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: Multibit-Legacy/multibit-hd

replaceUIMouseListener(comboBox.getComponent(0), mouseDelegate, mouseWrapper);

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