接收<identifier>预期错误并且不知道原因</identifier>

时间:2013-11-06 13:38:50

标签: java compiler-errors

我正在尝试调用void方法addToList,它除了将通过用户传递给它的两个字符串。我已经检查了dataSource类,以确保它确实接受那些作为参数。问题是我一直收到一个标识符&gt;该方法调用的预期错误,我无法弄清楚为什么。我使用数据源调用了其他方法,并没有遇到类似的问题。

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);



    }
  }

1 个答案:

答案 0 :(得分:1)

addToList

之后出现点符号
dataSource.addToList.(inputStringA, inputStringB);

                    ^_______ see the dot symbol.