public void actionPerformed(ActionEvent event) {
		String str; 
        int n;
        while (true){
//            str = JOptionPane.showInputDialog(null, "Please type the number of Undos:", "How many undo?", ""+Universe.curProfile.undo_num,  JOptionPane.PLAIN_MESSAGE);
            str = JOptionPane.showInputDialog("Please type the number of Undos:", ""+Universe.curProfile.undo_num);
            try {
                n = Integer.parseInt(str);
            }
            catch (NumberFormatException e){
                if (str != null)
                    continue;
                else 
                    return;
            }
                break;
        }

        //we better make sure this option is disabled for places where Undo does not apply.
        //((AutomatonEnvironment) environment).getUndoKeeper().setNumUndo(n);
        Universe.curProfile.setNumUndo(n);
        Universe.curProfile.savePreferences();


	}