public void actionPerformed(ActionEvent e) {
      if ("play".equals(e.getActionCommand())) {
          if(timer.isRunning()) timer.stop();
          else timer.start();
      }
      if ("clear".equals(e.getActionCommand())) {
          for(i=0;i<w;i++) for(j=0;j<h;j++) {
              table.setValueAt(" ", i, j);
              grid.giveCell(i,j).setStatus(false);
          }
          timer.stop();
          
      }
      if ("reset".equals(e.getActionCommand())) {
          grid = grid.reset();
          for(i=0;i<w;i++) for(j=0;j<h;j++) {
            table.setValueAt(" ", i, j);
            if(grid.giveCell(i,j).getStatus()) table.setValueAt("ALIVE", i, j);
          }
          table.repaint();
          
      }
 }