Hi,
I am trying to make a chess applet. The code shown below fully works. However I am having difficulty in making my drawRook and drawPawn methods into separate objects.
I want to do this so they can be put into separate files to clean up my main method.
Any pointers greatly appreciated in advance.

Java Code:
import java.applet.*;
import java.awt.*;

public class chess extends Applet{
  public static final int BORDER = 1;
  int noOfColumns = 8;
  int noOfRows = 8;
  int boardX = 1; int boardY = 1;
  int boardWidth = 400; int boardHeight = 400;
  int columnWidth = 50; int rowHeight = 50;
	
  int pieceImageX = 10;
  int pieceImageY = 10;
  Graphics pieceGraphics;	    
		
  public void drawBoard(Graphics g)
  {
	g.setColor(Color.black);
	
	//draw the chess board border
	g.drawRect(boardX-1, boardY-1, boardWidth+2, boardHeight+2);
	
	Grid boardGrid = new Grid(boardX, boardY,  columnWidth, rowHeight, noOfColumns, noOfRows);
	boardGrid.draw(g);
	  
	//Cell testCell = new Cell(pieceImageX,pieceImageY,50,50);
	//testCell.draw(g);
  }  // paint graphics
	
  public void drawPawn(int xCell, int yCell, boolean colourPiece, Graphics g)
  {
    if (!colourPiece) // white piece	
	{
	  if (yCell%2==0) // if row is even, even columns have white background
	  {
	    if (xCell%2==0)
	    {
          Image pieceImage = getImage (getCodeBase(), "pawn_ww.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
        } // if
	    else  // if the column is odd, black background
	    {
	      Image pieceImage = getImage (getCodeBase(), "pawn_wb.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
	    }
	  } // if
	  
	  if (yCell%2!=0) // if row is odd, even columns have black background
	  {
	    if (xCell%2==0)
	    {
          Image pieceImage = getImage (getCodeBase(), "pawn_wb.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
        } // if
	    else  // if the column is odd, white background
	    {
		  Image pieceImage = getImage (getCodeBase(), "pawn_ww.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
	    }
	  } // if
	} // if
	  
	if (colourPiece) // black piece	
	{
	  if (yCell%2==0) // if row is even, even columns have white background
	  {
	    if (xCell%2==0)
	    {
          Image pieceImage = getImage (getCodeBase(), "pawn_bw.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
        } // if
	    else  // if the column is odd, black background
	    {
	      Image pieceImage = getImage (getCodeBase(), "pawn_bb.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
	    }
	  } // if
	  
	  if (yCell%2!=0) // if row is odd, even columns have black background
	  {
	    if (xCell%2==0)
	    {
          Image pieceImage = getImage (getCodeBase(), "pawn_bb.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
        } // if
	    else  // if the column is odd, white background
	    {
		  Image pieceImage = getImage (getCodeBase(), "pawn_bw.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
	    }
	  } // if
	} // if  
  } // drawPawn
	
  public void drawRook(int xCell, int yCell, boolean colourPiece, Graphics g)
  {	
	if (!colourPiece) // white piece
	{
	  if (yCell%2==0) // if row is even, even columns have white background
	  {
	    if (xCell%2==0)
	    {
          Image pieceImage = getImage (getCodeBase(), "rook_ww.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
        } // if
	    else  // if the column is odd, black background
	    {
	      Image pieceImage = getImage (getCodeBase(), "rook_wb.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
	    }
	  } // if
	  
	  if (yCell%2!=0) // if row is odd, even columns have black background
	  {
	    if (xCell%2==0)
	    {
          Image pieceImage = getImage (getCodeBase(), "rook_wb.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
        } // if
	    else  // if the column is odd, white background
	    {
	      Image pieceImage = getImage (getCodeBase(), "rook_ww.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
	    }
	  } // if
	} // if
	
	if (colourPiece) // black piece
	{
	  if (yCell%2==0) // if row is even, even columns have white background
	  {
	    if (xCell%2==0)
	    {
          Image pieceImage = getImage (getCodeBase(), "rook_bw.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
        } // if
	    else  // if the column is odd, black background
	    {
	      Image pieceImage = getImage (getCodeBase(), "rook_bb.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
	    }
	  } // if
	  
	  if (yCell%2!=0) // if row is odd, even columns have black background
	  {
	    if (xCell%2==0)
	    {
          Image pieceImage = getImage (getCodeBase(), "rook_bb.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
        } // if
	    else  // if the column is odd, white background
	    {
	      Image pieceImage = getImage (getCodeBase(), "rook_bw.jpg");
          g.drawImage (pieceImage, (xCell*50)+boardX, yCell*50+boardY, this);
	      //Piece pawnPiece = new Piece((xCell*50+boardX),(yCell*50+boardY));
	    }
	  } // if
	} // if
  } // draw rook

  public void paint(Graphics g)
  {
	drawBoard(g);
	  
	// draw line of white pawns
	for (int i=0; i<8; i++) 
	{
	  drawPawn(i, 1, false, g); // x cell, y cell, background colour( 0=white), graphics
	}  // for
	  
	// draw line of black pawns
	for (int i=0; i<8; i++) 
	{
	  drawPawn(i, 6, true, g); // x cell, y cell, background colour( 0=white), graphics
	}  // for
	  
	// white rooks
	drawRook(0, 0, false, g);
	drawRook(7, 0, false, g);
	
	// black rooks
	drawRook(0, 7, true, g);
	drawRook(7, 7, true, g);
	
  } // paint
}  // Applet class