public ConfigureDialog(java.awt.Frame parent, CritterModel theModel) {
		super(parent, true);
		initComponents();

		config = new HashSet<CritterConfigurationPanel>();
		for (Class<? extends Critter> critterType : theModel.getPopulationCounters()
				.keySet()) {
			int pop = theModel.getPopulationCounters().get(critterType).intValue();
			addCritter(critterType, pop);
		}

		typeSelector.removeAllItems();
		for (Class<? extends Critter> type : CritterModel
				.getAvailableCritterTypes()) {
			typeSelector.addItem(type);
		}
		typeSelector.setSelectedIndex(0);

		addButton.addActionListener(new ActionListener() {

			@SuppressWarnings("unchecked")
			public void actionPerformed(ActionEvent e) {
				addCritter((Class<? extends Critter>) typeSelector.getSelectedItem(),
						Integer.parseInt(populationField.getText()));
			}
		});
	}