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

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

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

JComboBox.removeAllItems介绍

暂无

代码示例

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

private void installTestKindComboBox() {
  myTestKindComboBox.removeAllItems();
  myTestKindComboBox.setRenderer(getTestKindListCellRendererWrapper());
  for (GoTestRunConfiguration.Kind kind : GoTestRunConfiguration.Kind.values()) {
   myTestKindComboBox.addItem(kind);
  }
  myTestKindComboBox.addActionListener(e -> onTestKindChanged());
 }
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

private void installRunKindComboBox() {
 myRunKindComboBox.removeAllItems();
 myRunKindComboBox.setRenderer(getRunKindListCellRendererWrapper());
 for (GoApplicationConfiguration.Kind kind : GoApplicationConfiguration.Kind.values()) {
  myRunKindComboBox.addItem(kind);
 }
 myRunKindComboBox.addActionListener(e -> onRunKindChanged());
}

代码示例来源:origin: ballerina-platform/ballerina-lang

private void installRunKindComboBox() {
    myRunKindComboBox.getComponent().removeAllItems();
    myRunKindComboBox.getComponent().setRenderer(getRunKindListCellRendererWrapper());
    for (RunConfigurationKind kind : RunConfigurationKind.values()) {
      myRunKindComboBox.getComponent().addItem(kind);
    }
  }
}

代码示例来源:origin: winder/Universal-G-Code-Sender

@Override
synchronized public void restoreDefaults() throws Exception {
  FirmwareUtils.restoreDefaults((String)controllerConfigs.getSelectedItem());
  updatingCombo = true;
  String selected = (String) controllerConfigs.getSelectedItem();
  this.controllerConfigs.removeAllItems();
  for (String item : configFiles.keySet()) {
    this.controllerConfigs.addItem(item);
  }
  controllerConfigs.setSelectedItem(selected);
  updatingCombo = false;
  updateComponentsInternal(settings);
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void updateAlgorithmMethod() {
  methodSpinner.removeActionListener(methodListener);
  methodSpinner.removeAllItems();
  final List<String> methods = controller.getMethods();
  for (String method : methods) {
    methodSpinner.addItem(method);
  }
  methodSpinner.setSelectedItem(controller.getMethod());
  methodSpinner.setEnabled(methods.size() > 1);
  methodSpinner.addActionListener(methodListener);
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void updateAlgorithmMethod() {
  methodSpinner.removeActionListener(methodListener);
  methodSpinner.removeAllItems();
  final List<String> methods = controller.getMethods();
  for (String method : methods) {
    methodSpinner.addItem(method);
  }
  methodSpinner.setSelectedItem(controller.getMethod());
  methodSpinner.setEnabled(methods.size() > 1);
  methodSpinner.addActionListener(methodListener);
}

代码示例来源:origin: winder/Universal-G-Code-Sender

private void loadFirmwareSelector() {
  firmwareCombo.removeAllItems();
  List<String> firmwareList = FirmwareUtils.getFirmwareList();
  if (firmwareList.size() < 1) {
    displayErrorDialog(Localization.getString("mainWindow.error.noFirmware"));
  } else {
    java.util.Iterator<String> iter = firmwareList.iterator();
    while (iter.hasNext()) {
      firmwareCombo.addItem(iter.next());
    }
  }
}

代码示例来源:origin: winder/Universal-G-Code-Sender

private void loadFirmwareSelector() {
  firmwareComboBox.removeAllItems();
  List<String> firmwareList = FirmwareUtils.getFirmwareList();
  
  if (firmwareList.size() < 1) {
    displayErrorDialog(Localization.getString("mainWindow.error.noFirmware"));
  } else {
    java.util.Iterator<String> iter = firmwareList.iterator();
    while ( iter.hasNext() ) {
      firmwareComboBox.addItem(iter.next());
    }
  }
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void updateAlgorithms() {
  algorithmSpinner.removeActionListener(algorithmListener);
  algorithmSpinner.removeAllItems();
  for (ResizeAlgorithm algorithm : ResizeAlgorithm.values()) {
    algorithmSpinner.addItem(algorithm);
  }
  algorithmSpinner.setSelectedItem(controller.getAlgorithm());
  algorithmSpinner.addActionListener(algorithmListener);
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void updateDestination() {
  destinationSpinner.removeActionListener(destinationListener);
  destinationSpinner.removeAllItems();
  for (Destination format : Destination.values()) {
    destinationSpinner.addItem(format);
  }
  destinationSpinner.setSelectedItem(controller.getDestination());
  destinationSpinner.addActionListener(destinationListener);
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void updateAlgorithms() {
  algorithmSpinner.removeActionListener(algorithmListener);
  algorithmSpinner.removeAllItems();
  for (ResizeAlgorithm algorithm : ResizeAlgorithm.values()) {
    algorithmSpinner.addItem(algorithm);
  }
  algorithmSpinner.setSelectedItem(controller.getAlgorithm());
  algorithmSpinner.addActionListener(algorithmListener);
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void updateSourceResolution() {
  sourceResolutionSpinner.removeActionListener(sourceResolutionListener);
  sourceResolutionSpinner.removeAllItems();
  for (Resolution resolution : Resolution.nonVectorValues()) {
    sourceResolutionSpinner.addItem(resolution);
  }
  sourceResolutionSpinner.setSelectedItem(controller.getSourceResolution());
  sourceResolutionSpinner.addActionListener(sourceResolutionListener);
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void updateFormat() {
  formatSpinner.removeActionListener(formatListener);
  formatSpinner.removeAllItems();
  for (Format format : Format.nonVectorValues()) {
    formatSpinner.addItem(format);
  }
  formatSpinner.setSelectedItem(controller.getFormat());
  formatSpinner.addActionListener(formatListener);
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void updateSourceResolution() {
  sourceResolutionSpinner.removeActionListener(sourceResolutionListener);
  sourceResolutionSpinner.removeAllItems();
  for (Resolution resolution : Resolution.nonVectorValues()) {
    sourceResolutionSpinner.addItem(resolution);
  }
  sourceResolutionSpinner.setSelectedItem(controller.getSourceResolution());
  sourceResolutionSpinner.addActionListener(sourceResolutionListener);
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void updateFormat() {
  formatSpinner.removeActionListener(formatListener);
  formatSpinner.removeAllItems();
  for (Format format : Format.nonVectorValues()) {
    formatSpinner.addItem(format);
  }
  formatSpinner.setSelectedItem(controller.getFormat());
  formatSpinner.setEnabled(!controller.isNinePatch());
  formatSpinner.addActionListener(formatListener);
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void updateFormat() {
  formatSpinner.removeActionListener(formatListener);
  formatSpinner.removeAllItems();
  for (Format format : Format.nonVectorValues()) {
    formatSpinner.addItem(format);
  }
  formatSpinner.setSelectedItem(controller.getFormat());
  formatSpinner.setEnabled(!controller.isNinePatch());
  formatSpinner.addActionListener(formatListener);
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

private void updateFormat() {
  formatSpinner.removeActionListener(formatListener);
  formatSpinner.removeAllItems();
  for (Format format : Format.nonVectorValues()) {
    formatSpinner.addItem(format);
  }
  formatSpinner.setSelectedItem(controller.getFormat());
  formatSpinner.setEnabled(!controller.containsNinePatch());
  formatSpinner.addActionListener(formatListener);
}

代码示例来源:origin: winder/Universal-G-Code-Sender

private void loadPortSelector() {
  commPortComboBox.removeAllItems();
  List<String> portList = ConnectionFactory.getPortNames(backend.getSettings().getConnectionDriver());
  if (portList.size() < 1) {
    if (settings.isShowSerialPortWarning()) {
      displayErrorDialog(Localization.getString("mainWindow.error.noSerialPort"));
    }
  } else {
    // Sort?
    //java.util.Collections.sort(portList);
    for (String port : portList) {
      commPortComboBox.addItem(port);
    }
    commPortComboBox.setSelectedIndex(0);
  }
}

代码示例来源:origin: winder/Universal-G-Code-Sender

private void loadPortSelector() {
  portCombo.removeAllItems();
  List<String> portList = ConnectionFactory.getPortNames(backend.getSettings().getConnectionDriver());
  if (portList.size() < 1) {
    if (backend.getSettings().isShowSerialPortWarning()) {
      displayErrorDialog(Localization.getString("mainWindow.error.noSerialPort"));
    }
  } else {
    for (String port : portList) {
      portCombo.addItem(port);
    }
    portCombo.setSelectedIndex(0);
  }
}

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

public void setSlotAndTeams(Byte slotAndTeamCount) {
  slotComboBox.removeAllItems();
  teamComboBox.removeAllItems();
  for (byte i = 1; i < slotAndTeamCount + 1; i++) {
    slotComboBox.addItem(i);
    teamComboBox.addItem(i);
  }
}

相关文章

JComboBox类方法