private void setResponse()
    {
        try{
        ButtonModel bm = AnswerButtons.getSelection();
        String selectedind = bm.getActionCommand();
        
        selectedAnswers.put(quiz.questionList.get(qIndex).dbId, Integer.parseInt(selectedind));
        }
        catch (NullPointerException npe)
        {
            //If no answer was selected, this gets thrown!! Catching it stops it breaking really.
        }
    }