我不知道为什么null
会出现。checkBox
应该有一个分配给它的名字
imagesToBeImportedCheckBox = new JCheckBox[imagesToBeImported.size()];
int check_Box_Number=0;
for(ResourceListObject currentImage : imagesToBeImported){
imagesToBeImportedCheckBox[check_Box_Number] = new JCheckBox(currentImage.getName());
System.out.println("Main Debugger On");
System.out.println(currentImage.getName());
System.out.println(check_Box_Number);
System.out.println(imagesToBeImportedCheckBox[check_Box_Number].getName());
imagesToBeImportedCheckBox[check_Box_Number].setBounds(6, gapping+check_Box_Number*26, 368, 23);
panel_1.add(imagesToBeImportedCheckBox[check_Box_Number]);
check_Box_Number++;
}
这是输出
Main Debugger On
Migration-image
0
null
Main Debugger On
Imported on: Tuesday, August 20, 2013
1
null