JButton buttonadd = new JButton(); //创建添加按钮
buttonadd.addActionListener(new AddBookActionListener()); //注册监听器
buttonadd.setText("添加"); //设置按钮文本
bottomPanel.add(buttonadd);
第二行错了。波浪线花在AddBookActionListener()下,提示 不能实例化类型addActionListener
buttonadd.addActionListener(new AddBookActionListener()); //注册监听器
buttonadd.setText("添加"); //设置按钮文本
bottomPanel.add(buttonadd);
第二行错了。波浪线花在AddBookActionListener()下,提示 不能实例化类型addActionListener
这个应该是
buttonadd.addActionListener(new ActionListener());
public void actionPerformed(ActionEvent e){...}
}