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

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

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

JComboBox.removeAll介绍

暂无

代码示例

代码示例来源:origin: GoSecure/csp-auditor

public void clearDomains() {
  comboBox1.removeAll();
}

代码示例来源:origin: unchartedsoftware/aperture-tiles

private void updateAvailableLevels () {
  if (null != _pyramidIO && null != _pyramidId && !_pyramidId.isEmpty()) {
    try {
      String rawMetaData = _pyramidIO.readMetaData(_pyramidId);
      PyramidMetaData metaData = new PyramidMetaData(rawMetaData);
      _levelField.removeAll();
      _xField.removeAll();
      _yField.removeAll();
      List<Integer> levels = metaData.getValidZoomLevels();
      for (Integer level: levels) {
        _levelField.addItem(level);
      }
      _levelField.setSelectedIndex(0);
      return;
    } catch (Exception e) {
      LOGGER.log(Level.WARNING, "Error getting level metadata for "
            + _pyramidId);
    }
  }
  _levelField.removeAllItems();
  _xField.removeAll();
  _yField.removeAll();
}

代码示例来源:origin: unchartedsoftware/aperture-tiles

private void updateAvailableLevels () {
  if (null != _pyramidIO && null != _pyramidId && !_pyramidId.isEmpty()) {
    try {
      String rawMetaData = _pyramidIO.readMetaData(_pyramidId);
      PyramidMetaData metaData = new PyramidMetaData(rawMetaData);
      _levelField.removeAll();
      _xField.removeAll();
      _yField.removeAll();
      List<Integer> levels = metaData.getValidZoomLevels();
      for (Integer level: levels) {
        _levelField.addItem(level);
      }
      _levelField.setSelectedIndex(0);
      return;
    } catch (Exception e) {
      LOGGER.log(Level.WARNING, "Error getting level metadata for "
            + _pyramidId);
    }
  }
  _levelField.removeAllItems();
  _xField.removeAll();
  _yField.removeAll();
}

代码示例来源:origin: jsettlers/settlers-remake

public void setPossibleTypes(EPlayerType[] playerTypes) {
  typeComboBox.removeAll();
  Arrays.asList(playerTypes)
      .stream()
      .map(PlayerTypeUiWrapper::new)
      .forEach(typeComboBox::addItem);
}

代码示例来源:origin: org.appdapter/org.appdapter.lib.gui

@Override public void run() {
    try {
      classField.setEnabled(false);
      synchronized (classesShownHere) {
        classesShownHere.clear();
        classField.removeAll();
      }
    } finally {
      classField.setEnabled(true);
    }
  }
});

代码示例来源:origin: apache/axis2-java

private void loadPortNames() {
  int selectionIndex = cmbServiceName.getSelectedIndex();
  if (selectionIndex != -1) {
    java.util.List ports = codegenBean.getPortNameList((QName) serviceNameList
        .get(selectionIndex));
    if (!ports.isEmpty()) {
      cmbPortName.removeAll();
      for (int i = 0; i < ports.size(); i++) {
        // add the local part of the
        cmbPortName.addItem(ports.get(i).toString());
      }
      cmbPortName.setSelectedIndex(0);
    } else {
      //Todo error message null
    }
  }
}
public void populateOptions(){

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

/**
 * The aggregate components which compise the combo box are 
 * unregistered and uninitialized. This method is called as part of the
 * UI uninstallation process.
 */
protected void uninstallComponents()
{
  if (arrowButton != null)
  {
    unconfigureArrowButton();
  }
  if (editor != null)
  {
    unconfigureEditor();
  }
  comboBox.removeAll(); // Just to be safe.
  arrowButton= null;
}

代码示例来源:origin: apache/axis2-java

cmbServiceName.removeAll();
for (int i = 0; i < serviceNameList.size(); i++) {
if (cmbServiceName!=null) cmbServiceName .removeAll();
if (cmbPortName!=null) cmbPortName.removeAll();

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

/**
 * Adds concept data sources to drop down box
 */
private void populateRestrictDataSource() {
  restrictDataSource.setEnabled(withinDataSource.isSelected());
  // check only for data sources with concepts
  Set<DataSource> dataSources = new HashSet<DataSource>();
  for (DataSource dataSource : graph.getMetaData().getDataSources()) {
    if (graph.getConceptsOfDataSource(dataSource).size() > 0) {
      dataSources.add(dataSource);
    }
  }
  // sort data sources
  DataSource[] array = dataSources.toArray(new DataSource[0]);
  Arrays.sort(array);
  // dummy data source
  DataSource none = graph.getMetaData().getDataSource("NONE");
  if (none == null)
    none = graph.getMetaData().getFactory().createDataSource("NONE");
  // add data source to drop-down box
  restrictDataSource.removeActionListener(this);
  restrictDataSource.removeAll();
  restrictDataSource.addItem(none);
  for (DataSource dataSource : array) {
    restrictDataSource.addItem(dataSource);
  }
  restrictDataSource.addActionListener(this);
  restrictDataSource.setSelectedIndex(0);
  restrictDataSource.revalidate();
}

代码示例来源:origin: org.zaproxy/zap

return;
getHostSelect().removeAll();
for (HostProcess hp : scan.getHostProcesses()) {
  getHostSelect().addItem(hp.getHostAndPort());

相关文章

JComboBox类方法