当前位置: 首页>>代码示例>>Java>>正文


Java DefaultComboBoxModel.removeAllElements方法代码示例

本文整理汇总了Java中javax.swing.DefaultComboBoxModel.removeAllElements方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultComboBoxModel.removeAllElements方法的具体用法?Java DefaultComboBoxModel.removeAllElements怎么用?Java DefaultComboBoxModel.removeAllElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.DefaultComboBoxModel的用法示例。


在下文中一共展示了DefaultComboBoxModel.removeAllElements方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updatePlatforms

import javax.swing.DefaultComboBoxModel; //导入方法依赖的package包/类
private void updatePlatforms() {
    final SourceLevelQuery.Result slqr = SourceLevelQuery.getSourceLevel2(prj.getProjectDirectory());
    final String sl = slqr.getSourceLevel();
    final SourceLevelQuery.Profile profile = slqr.getProfile();
    final DefaultComboBoxModel<Object> model = (DefaultComboBoxModel<Object>) platforms.getModel();
    model.removeAllElements();
    for (J2SERuntimePlatformProvider pp : prj.getLookup().lookupAll(J2SERuntimePlatformProvider.class)) {
        for (JavaPlatform jp : pp.getPlatformType(new SpecificationVersion(sl), profile)) {
            model.addElement(jp);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ResolveBrokenRuntimePlatform.java

示例2: getTableCellEditorComponent

import javax.swing.DefaultComboBoxModel; //导入方法依赖的package包/类
public Component getTableCellEditorComponent(JTable table, Object value,
		boolean isSelected, int row, int column) {
	ResultSet set = Dao.query("select * from tb_spinfo where gysName='"
			+gysName+"'");
	DefaultComboBoxModel dfcbm = (DefaultComboBoxModel) getModel();
	dfcbm.removeAllElements();
	dfcbm.addElement(new TbSpinfo());
	try {
		while (set.next()) {
			TbSpinfo spinfo=new TbSpinfo();
			spinfo.setId(set.getString("id").trim());
			spinfo.setSpname(set.getString("spname").trim());
			spinfo.setCd(set.getString("cd").trim());
			spinfo.setJc(set.getString("jc").trim());
			spinfo.setDw(set.getString("dw").trim());
			spinfo.setGg(set.getString("gg").trim());
			spinfo.setBz(set.getString("bz").trim());
			spinfo.setPh(set.getString("ph").trim());
			spinfo.setPzwh(set.getString("pzwh").trim());
			spinfo.setMemo(set.getString("memo").trim());
			spinfo.setGysname(set.getString("gysname").trim());
			dfcbm.addElement(spinfo);
		}
	} catch (SQLException e) {
		e.printStackTrace();
	}
	return this;
}
 
开发者ID:Edward7Zhang,项目名称:SuperMarketManageSystem,代码行数:29,代码来源:customCellEditor.java

示例3: loadUserTypesCombo

import javax.swing.DefaultComboBoxModel; //导入方法依赖的package包/类
private void loadUserTypesCombo() {
    User.UserType ty = (User.UserType) userTypesCombo.getSelectedItem();
    User.UserType[] utypes = User.UserType.values();
    DefaultComboBoxModel def = (DefaultComboBoxModel) userTypesCombo.getModel();
    def.removeAllElements();
    for (User.UserType utype : utypes) {
        def.addElement(utype);
    }
    if (ty != null) {
        userTypesCombo.setSelectedItem(ty);
    }
}
 
开发者ID:isu3ru,项目名称:java-swing-template,代码行数:13,代码来源:Preferences.java

示例4: loadUserLevelCombo

import javax.swing.DefaultComboBoxModel; //导入方法依赖的package包/类
private void loadUserLevelCombo() {
    UserLevel ul = (UserLevel) ulevel_combo.getSelectedItem();
    DefaultComboBoxModel def = (DefaultComboBoxModel) ulevel_combo.getModel();
    def.removeAllElements();
    List<UserLevel> userLevelsList = UserController.getUserLevelsList();
    for (UserLevel ul1 : userLevelsList) {
        def.addElement(ul1);
    }
    if (ul != null) {
        ulevel_combo.setSelectedItem(ul);
    }
}
 
开发者ID:isu3ru,项目名称:java-swing-template,代码行数:13,代码来源:Preferences.java

示例5: loadUserLevelCombo_Privileges

import javax.swing.DefaultComboBoxModel; //导入方法依赖的package包/类
private void loadUserLevelCombo_Privileges() {
    UserLevel ul = (UserLevel) cmb_user_levels.getSelectedItem();
    DefaultComboBoxModel def = (DefaultComboBoxModel) cmb_user_levels.getModel();
    def.removeAllElements();
    List<UserLevel> userLevelsList = UserController.getUserLevelsList();
    for (UserLevel ul1 : userLevelsList) {
        def.addElement(ul1);
    }
    if (ul != null) {
        cmb_user_levels.setSelectedItem(ul);
    }
}
 
开发者ID:isu3ru,项目名称:java-swing-template,代码行数:13,代码来源:Preferences.java

示例6: loadUsersCombo_Privileges

import javax.swing.DefaultComboBoxModel; //导入方法依赖的package包/类
private void loadUsersCombo_Privileges() {
    ArrayList<User> usersList = UserController.getUsersList();
    if (usersList.size() > 0) {
        DefaultComboBoxModel ucmod = (DefaultComboBoxModel) cmb_users.getModel();
        ucmod.removeAllElements();

        for (User usr : usersList) {
            ucmod.addElement(usr);
        }
    }
}
 
开发者ID:isu3ru,项目名称:java-swing-template,代码行数:12,代码来源:Preferences.java

示例7: loadUsersList

import javax.swing.DefaultComboBoxModel; //导入方法依赖的package包/类
private void loadUsersList() {
    ArrayList<User> usersList = UserController.getUsersList();
    DefaultComboBoxModel def = (DefaultComboBoxModel) cmb_user.getModel();
    def.removeAllElements();
    if (usersList.size() > 0) {
        for (User user : usersList) {
            if (user.getUserStatus() == 1) {
                def.addElement(user);
            }
        }
    }
}
 
开发者ID:isu3ru,项目名称:java-swing-template,代码行数:13,代码来源:Login.java

示例8: clearBoxModel

import javax.swing.DefaultComboBoxModel; //导入方法依赖的package包/类
private void clearBoxModel(DefaultComboBoxModel mdl) {
	mdl.removeAllElements();
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:4,代码来源:EditProjectTagController.java

示例9: prepareCombo

import javax.swing.DefaultComboBoxModel; //导入方法依赖的package包/类
protected void prepareCombo(JComboBox combo, int row, int column){
  Feature feature = featureList.get(row);
  DefaultComboBoxModel comboModel = (DefaultComboBoxModel)combo.getModel(); 
  comboModel.removeAllElements();
  switch(column){
    case NAME_COL:
      List<String> fNames = new ArrayList<String>();
      if(schema != null && schema.getFeatureSchemaSet() != null){
        Iterator<FeatureSchema> fSchemaIter = schema.getFeatureSchemaSet().iterator();
        while(fSchemaIter.hasNext())
          fNames.add(fSchemaIter.next().getFeatureName());
      }
      if(!fNames.contains(feature.name))fNames.add(feature.name);
      Collections.sort(fNames);
      for(Iterator<String> nameIter = fNames.iterator(); 
          nameIter.hasNext(); 
          comboModel.addElement(nameIter.next()));
      combo.getEditor().getEditorComponent().setBackground(defaultBackground);          
      combo.setSelectedItem(feature.name);
      break;
    case VALUE_COL:
      List<Object> fValues = new ArrayList<Object>();
      if(feature.isSchemaFeature()){
        Set<Object> permValues = schema.getFeatureSchema(feature.name).
          getPermittedValues();
        if(permValues != null) fValues.addAll(permValues);
      }
      if(!fValues.contains(feature.value)) fValues.add(feature.value);
      Collections.sort(fValues, defaultComparator);
      for(Iterator<Object> valIter = fValues.iterator(); 
          valIter.hasNext(); 
          comboModel.addElement(valIter.next()));
      combo.getEditor().getEditorComponent().setBackground(feature.isCorrect() ?
          defaultBackground :
          (feature.isRequired() ? REQUIRED_WRONG : OPTIONAL_WRONG));
      combo.setSelectedItem(feature.value);
      break;
    default: ;
  }
  
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:42,代码来源:FeaturesSchemaEditor.java


注:本文中的javax.swing.DefaultComboBoxModel.removeAllElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。