private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton1ActionPerformed
    {//GEN-HEADEREND:event_jButton1ActionPerformed
        if (!gameover) {
            if (rule.turn()) {
                if (rule.check(0, 0)) {
                    rule.pressed(0, 0);
                    if (rule.changeTurn()) {
                        ai.takeTurn(this, rule, new Coordinate(0, 0));
                        if (!rule.winner().equalsIgnoreCase(winner)) {
                            gameover = true;
                            winner = rule.winner();
                            jLabel1.setText(winner);
                        }
                    }
                    else {
                        gameover = true;
                        winner = rule.winner();
                        jLabel1.setText(winner);
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton1ActionPerformed