public void mouseClicked( MouseEvent e ) {
    int grid_x, grid_y;
    if ( l.user_move != NOT_MOVE ) {
      x = e.getX();
      y = e.getY();
      grid_x = (int)((x-8)/35);
      grid_y = (7 - (int)((y-8)/35));
      if ( l.user_move == PICK_PIECE ) {
        if ( l.board.piece(grid_x, grid_y)) {
          l.x1 = grid_x;
          l.y1 = grid_y;
          l.user_move = PICK_MOVE;
        }
        return;
      }
      else if (l.user_move == PICK_MOVE ) {
        if ( l.board.piece( grid_x, grid_y ) ) {
          l.x1 = grid_x;
          l.y1 = grid_y;
          l.x2 = l.y2 = -1;
          l.user_move = END_MOVE;
          return;
        }
        l.x2 = grid_x;
        l.y2 = grid_y;
        l.user_move = END_MOVE;
      }
    }
  }