private void onChangeMapSize(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onChangeMapSize
        try {
            toggler.setState(false);
            game.setMapSize(Integer.parseInt(JOptionPane.showInputDialog(this, "This will clear the map.\nEnter map size:", game.getMapSize())));
            game.reset();
            repaint();
            panel.resetFrames();
            game.resetTicks();
        } catch (NumberFormatException ex) {
            // ignore
        }
    }//GEN-LAST:event_onChangeMapSize