我正在尝试调用void方法addToList,它除了将通过用户传递给它的两个字符串。我已经检查了dataSource类,以确保它确实接受那些作为参数。问题是我一直收到一个标识符>该方法调用的预期错误,我无法弄清楚为什么。我使用数据源调用了其他方法,并没有遇到类似的问题。
public class JListFromFile extends JFrame {
private TextField wordA;
private TextField wordB;
private JButton openButton;
private JButton newButton;
private JButton addButton;
private JButton deleteButton;
private JButton saveButton;
private TextField output;
private JList listFromFile;
private JPanel listPanel;
private JPanel textPanel;
private JPanel inputPanel;
private JPanel buttonsPanel;
private DataSource2 dataSource;
private WordPair wordPair;
public JListFromFile ()
{
// create the object to provide the data
dataSource = new DataSource2();
.
.
.
private class AddButtonListener implements ActionListener
{
public void actionPerformed (ActionEvent event)
{
listFromFile.setListData(new Object[0]);
wordA.setEnabled(true);
wordB.setEnabled(true);
String inputStringA = wordA.getText();
String inputStringB = wordB.getText();
//here is the problem
dataSource.addToList.(inputStringA, inputStringB);
}
}
答案 0 :(得分:1)
在addToList
dataSource.addToList.(inputStringA, inputStringB);
^_______ see the dot symbol.