else if(e.getSource()==button3){
JButton[] addSong = new JButton[50];
JLabel[] label = new JLabel[50];
JPanel[] smallPanel = new JPanel[50];
JPanel panel = new JPanel(new GridLayout(1,50));
for(int i=0;i<50;i++){
addSong[i].setText("+");
label[i].setText("Name of song");
smallPanel[i].add(addSong[i]);
smallPanel[i].add(label[i]);
panel.add(smallPanel[i]);
}
tabs.addTab("All Songs",panel);
}
for 循环中的所有语句都给了我一个 NullPointerException。我是 Java 新手 =/