I'm trying to write a four-in-a-row game in java with RMI. I am just currently stuck on the bit when the user selects the column to enter their play coin.
I am trying to model this game on this:

Connect 4

Thanks for any help you can give me.


My Code ---------

Client

Java Code:
   import java.rmi.*;
   import java.net.*;
   import java.io.*;
   import java.util.*;
   import java.awt.BorderLayout;
   import java.awt.Container;
   import java.awt.Dimension;
   import javax.swing.*; 
   import java.awt.*; 
   import javax.swing.border.*;
   import java.awt.event.*;
   import java.awt.event.ActionEvent;



    public class Connect4Client implements MouseListener
   {
      Connect4Interface obj;
      int currentPlayer;
      int resetGrid=0;
      int gridMove=0;
      int winningMove=0;  
      JLabel[] labelBtns = new JLabel[41];
   //int grid[gridNos];
   //int cell[];
   
   
      int grid[] = {0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,
                0,0,0,0,0,0,0};
    
    //int 
   
    //private JLabel labels[] = {};
                
       public Connect4Client()
      {
         JFrame frame = new JFrame("Connect Four");
         JPanel p = (JPanel) frame.getContentPane();
         JPanel panel = new JPanel();
         panel.setLayout(new GridLayout(6,7));
      	
         for (int i=0; i<labelBtns.length; i++) {
            labelBtns[i] = new JLabel(new ImageIcon("../images/"+grid[i]+".png"));
            labelBtns[i].addMouseListener(this);      
				String myString = Integer.toString(i);
				labelBtns[i].setText(myString);
            panel.add(labelBtns[i]);
         }
      	
         JPanel buttons = new JPanel();
         buttons.setLayout(new GridLayout(1,2));
         JLabel menu = new JLabel(new ImageIcon("../images/menu.png"));
         menu.addMouseListener(this);
         JLabel newGame = new JLabel(new ImageIcon("../images/newgame.png"));
         buttons.add(newGame);
         buttons.add(menu);
         p.setLayout(null);
         p.add(panel); 
         panel.setBounds(0,0,280,235);
         p.add(buttons); 
         buttons.setBounds(0,175,275,150);
         frame.setSize(286,295);
         frame.setVisible(true);
         frame.setResizable(false);
      }    
     
      
       public void mouseClicked(MouseEvent ev) {
         JLabel label = (JLabel) ev.getComponent();
			int i = Integer.parseInt(label.getText().trim());
         int cell = i;
         if (cell != -1) {
            obj.gridMove(cell, 1);
         }
      }
   
       public void mouseEntered(MouseEvent ev) {
      
      }
   	
       public void mouseExited(MouseEvent ev) {
      }
   
       public void mousePressed(MouseEvent ev) {
       
      }
       public void mouseReleased(MouseEvent ev) {
      }
   
       public static void main(String argv[])
      {
             
         try
         {
            Connect4Interface obj = (Connect4Interface)Naming.lookup("rmi://localhost/Connect4Server");
            Connect4Client con4 = new Connect4Client();
         
         }
             catch(Exception e)
            {
               System.out.println("Connect4Client Error :" + e.getMessage());
            }
      
      
      //System.out.println(""+lowercase);
      
      }
   }
Server

Java Code:
   import java.rmi.*;
   import java.rmi.server.UnicastRemoteObject;
   import java.awt.BorderLayout;
   import java.awt.Container;
   import java.awt.Dimension;
   import javax.swing.*; 
   import java.awt.*; 
   import javax.swing.border.*;
   import java.util.ArrayList;

    public class Connect4Server extends UnicastRemoteObject implements Connect4Interface
   {
      private String objectName;
      private int grid[] = {0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,
                0,0,0,0,0,0,0};
   
      ArrayList HLines = new ArrayList();
   //HLines.add(0,1,2,3,4);
   // 	{5,6,7,8,9}
   // 	{10,11,12,13,14}
   // 	{15,16,17,18,19}
   // 	{20,21,22,23,24}
   // 	ArrayList VLines
   // 	ArrayLise DLines
                
                
      private int currentPlayer;
   
       public Connect4Server(String s) throws RemoteException
      {
         super();
         objectName=s;
      }
   
       public int[] resetGrid()
      {
         for (int i=0;i<grid.length;i++)
            grid[i] = 0;
            
         return grid;
      }
   
       public int[] gridMove(int cell, int who)
      {
      	for (int i; 
         if (currentPlayer == 1) {
            grid[cell].setIcon(new ImageIcon("../images/1.png"));
         }
         else {
            grid[cell].setIcon(new ImageIcon("../images/2.png"));
         }			
      
         return grid;
      }
   
       public int[] winningMove(int who)
      {
         return grid;
      }
   
       public static void main(String argv[])
      {
         RMISecurityManager sm = new RMISecurityManager();
         System.setSecurityManager(sm);
         try
         {
            Connect4Server obj = new Connect4Server("Connect4Server");
            Naming.rebind("rmi://localhost/Connect4Server",obj);
            System.out.println("Connect4Server bound to registry");
         }
             catch(Exception e)
            {
               System.out.println("Connect4Server Error :" + e.getMessage());
            }
      }
   }

Thanks for any help you can give me.