当我尝试将JLabel数组添加到我的面板时,我得到一个NullPointer异常。
错误发生在内循环的最后一行
Panel panneauScore;
Panel panneaujouonsAuGolf;
Label [][] arrayscore = new Label [4][9];
for (int c = 0; c<arrayscore.length; c++){
for (int p = 0; p<arrayscore[c].length; p++){
score1 = Choisirrandom();
nombre[c][p] = score1;
arrayscore[c][p]= new Label(String.valueOf(nombre[c][p]));
panneauScore.add(arrayscore[c][p]);
}
}