for(JCheckBox currentCheckBox : imagesToBeImportedCheckBox){
if(currentCheckBox.isSelected()){
System.out.println("The text Box selected for removing are"+currentCheckBox.getText());
}
}
for(JCheckBox currentCheckBox : imagesToBeImportedCheckBox){
if(currentCheckBox.isSelected()){
System.out.println("I am entering in the loop where this image has to be removed "+currentCheckBox.getText());
imagesToBeImported.remove(currentCheckBox.getText());
}
}
for(ResourceListObject currentImage : imagesToBeImported){
System.out.println("After removing the images left are "+currentImage.getName());
}
这是输出
选择删除的文本框是 aix71b
选择删除的文本框是 Migration-image
我正在进入必须删除此图像的循环 aix71b
我正在进入必须删除此图像的循环迁移图像
删除后剩下的图像是aix71b
删除后留下的图像是 Migration-image