Java actual and formal argument lists differ in length?
<p>I am working on a game for my programming class and I wrote the code in Eclipse where it has no visible errors, yet when I compile it I get the following error message:</p>

<blockquote>
  <p>TogizKumalak20.java:220: error: method moveBoard in class board20 cannot be applied to given types;
  playBoard.moveBoard(playTurn, keyCharAsInt);
  required: cup20 found: int,int
  reason: actual and formal argument lists differ in length</p>
</blockquote>

<p>I am not sure what is causing this and how to fix it.  Any input is greatly appreciated, and thank you in advance!</p>

<pre class="lang-java prettyprint-override"><code>import java.awt.Container;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Point2D;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import java.awt.Cursor;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.*;
import java.io.*;
import javax.swing.JFileChooser;
import java.awt.Color;
import java.awt.event.*;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;


public class TogizKumalak20
{
    public static void main(String[] args)
    {
        TKFrame myFrame = new TKFrame();
        myFrame.setTitle("Togiz Kumalak U22");
        myFrame.setVisible(true);
    }
}

class TKFrame extends JFrame
{
    private TKPanel myPanel;
    private final int FRAMEW = 700;
    private final int FRAMEH = 700;

    public TKFrame()
    {
        setSize(FRAMEW, FRAMEH);

        myPanel = new TKPanel();
        Container contentPane = getContentPane();

        contentPane.add(myPanel);
        addWindowListener(new WindowCloser());

        JMenuBar menuBar = new JMenuBar();
        setJMenuBar(menuBar);

        JMenu fileMenu = new JMenu("File");
        menuBar.add(fileMenu);

        JMenuItem restartItem = new JMenuItem("Restart");
        fileMenu.add(restartItem);

        RestartListener myRestartListener = new RestartListener();
        restartItem.addActionListener(myRestartListener);

        JMenuItem exitItem = new JMenuItem("Exit");
        fileMenu.add(exitItem);

        ExitListener myExitListener = new ExitListener();
        exitItem.addActionListener(myExitListener);
    }

    private class WindowCloser extends WindowAdapter
    {
        public void windowClosing(WindowEvent event)
        {
            dispose();
        }
    }

    private class RestartListener implements ActionListener
    {
        public void actionPerformed(ActionEvent event)
        {

            myPanel.renewBoard();

            myPanel.renewTextArea();

            myPanel.setMoveCount(1);
        }
    }

    private class ExitListener implements ActionListener
    {
        public void actionPerformed(ActionEvent event)
        {
            System.exit(0);
        }
    }
}

class TKPanel extends JPanel
{
    private board20 playBoard;
    private int playTurn;
    private JTextArea actionRecordArea;
    private JScrollPane actionScrollPane;
    private int moveCount = 1;

    public TKPanel()
    {
        super();
        playTurn = 1;
        playBoard = new board20();
        actionRecordArea = new JTextArea(6, 24);
        actionRecordArea.setEditable(false);
        actionScrollPane = new JScrollPane(actionRecordArea,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        add(actionScrollPane, "North");
        addMouseListener(new MouseHandler());
        addMouseMotionListener(new MouseMotionHandler());
        addKeyListener(new KeyHandler());
        setFocusable(true);
    }

    public void renewBoard()
    {
        playBoard = new board20();
        repaint();
    }

    public void renewTextArea()
    {
        actionRecordArea.setText("");
        repaint();
    }

    public int getMoveCount()
    {
        return moveCount;
    }

    public void setMoveCount(int countIn)
    {
        moveCount = countIn;
    }

    public void paintComponent(Graphics g)
    {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D) g;
        playBoard.drawBoard(g2);
    }

    private class MouseHandler extends MouseAdapter
    {
        public void mouseClicked(MouseEvent event)
        {
            cup20 returnedCup;

            returnedCup = playBoard.isTheMouseInaCup(event.getPoint());

            if(returnedCup != null)
            {
                if(returnedCup.getWhoseCup() == playTurn)
                {
                    setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));

                    playBoard.moveBoard(returnedCup);

                    int whatCupNumber = playBoard.getCupNumber(returnedCup);
                    actionRecordArea.append("Move:  " + moveCount + ".  Player:  " + playTurn + ".  Cup:  " + whatCupNumber + ".\n");
                    moveCount++;

                    if(playTurn == 1)
                      playTurn = 2;
                    else
                      playTurn = 1;

                    repaint();
                }
            }
        }
    }

    private class MouseMotionHandler extends MouseMotionAdapter
    {
        public void mouseMoved(MouseEvent event)
        {
            cup20 retCup = playBoard.isTheMouseInaCup(event.getPoint());

            if(retCup == null)
              setCursor(Cursor.getDefaultCursor());
            else
            {
                if(retCup.getWhoseCup() == playTurn)
                  setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                else
                  setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
            }
        }
    }

    private class KeyHandler extends KeyAdapter
    {
        public void keyTyped(KeyEvent event)
        {
            char keyChar = event.getKeyChar();

            int keyCharAsInt;

            if(keyChar == '1' || keyChar == '2' || keyChar == '3' || keyChar == '4' || keyChar == '5' || keyChar == '6' || keyChar =='7' || keyChar == '8' || keyChar == '9')
            {
                keyCharAsInt = (int) keyChar - 48;

                setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));

                playBoard.moveBoard(playTurn, keyCharAsInt);

                actionRecordArea.append("Move:  " + moveCount + ".  Player:  " + playTurn + ".  Cup:  " + keyCharAsInt + ".\n");
                moveCount++;

                if(playTurn == 1)
                  playTurn = 2;
                else
                  playTurn = 1;

                repaint();
            }
            else
            {
            }
        }

        public board20 getBoard()
        {
            return playBoard;
        }

        public String getText()
        {
            return actionRecordArea.getText();
        }

        public void setText(String textIn)

    {
            actionRecordArea.setText(textIn);
        }
    }

}
</code></pre>
