无法弄清楚为什么我会收到此异常,控制台返回此消息:
public static void main(String [] args){
JFrame b = new JFrame("Lotus");
Container pieces = new Container();
JLabel[] labelsP1 = new JLabel[10];
JLabel[] labelsP2 = new JLabel[10];
for(int i = 0 ; i < labelsP1.length ; i++){
labelsP1[i] = new JLabel(B1);
for(int j = 0 ; j < labelsP2.length ; j++){
labelsP2[j] = new JLabel(B2);
}
for (JLabel label : labelsP1) {
pieces.add(label);
}
Container c = b.getContentPane();
c.setLayout(new GridLayout(13,3));
c.add(pieces);
}