@Override public void actionPerformed(ActionEvent e) { if (reiniciar == e.getSource()) reinicio(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if (botones[i][j] == e.getSource()) { matriz[i][j] = 0; botones[i][j].setText("X"); botones[i][j].setEnabled(false); logger.info("Jugador " + nombres[0] + " le dio en el boton" + i + " " + j); this.regla(i, j); IA inteligenciaArtificial = new IA(); inteligenciaArtificial.PosiblesJugada(matriz); int[] posicion = inteligenciaArtificial.getJugadaFinal(); matriz[posicion[0]][posicion[1]] = 1; botones[posicion[0]][posicion[1]].setText("0"); botones[posicion[0]][posicion[1]].setEnabled(false); logger.info("la Computadora le dio en el boton " + posicion[0] + " " + posicion[1]); this.regla(posicion[0], posicion[1]); } } } }