private class ButtonSelect implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
Object Ps = e.getSource();
String selectedLanguage = (String) languageList.getSelectedItem();
JOptionPane.showMessageDialog(StudentRecordsGUI.this,
"You selected the language: " + selectedLanguage);
if (selectedLanguage != "English") {
JOptionPane.showMessageDialog(StudentRecordsGUI.this,
"I'm sorry. The language you have selected is currently not available. Please try again.");
}
else
setVisible(false);
new Record (student, this, "Student Records");
}
} //end class ButtonSelect
错误:
java:52: error: constructor Record in class StudentRecordsGUI.Record cannot be applied to given types;
new Record (student, this, "Student Records");
^
required: Student
found: ArrayList<Student>,StudentRecordsGUI.ButtonSelect,String
reason: actual and formal argument lists differ in length
我需要使用:
ArrayList<Student> student = new ArrayList<Student>();
从Student
课程获取信息,但不会接受。{p>我该如何编辑这一行呢?