@Override
	public void actionPerformed(ActionEvent e) {
		if ("export test".equals(e.getActionCommand())) {
			try {
				Control.GedExportTest(dwarfList);
			} catch (SAXException e1) {
				e1.printStackTrace();
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		}
		if ("import debug legends".equals(e.getActionCommand())) {
			xmlImportButton.setEnabled(false);
			final JFileChooser chooser = new JFileChooser();
                        chooser.setFileFilter(new XMLFilter());
			if(chooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION)
                        {
                            xmlImportButton.setEnabled(true);
                            return;
                        }
			
			Runnable r = new Runnable() {
                            public void run() {
                                if ((dwarfList = Control.ImportXML(chooser.getSelectedFile().getPath(), DebugWindow.this)) != null) {
                                    progressBar.setIndeterminate(false);    
                                    JOptionPane.showMessageDialog(rootPane, "XML file finished importing.", "Import finished", JOptionPane.INFORMATION_MESSAGE);
                                    enableAllButtons();
                                } else {
                                    xmlImportButton.setEnabled(true);	
                                    progressBar.setIndeterminate(false);
                                }
                            }
			};
			Thread t = new Thread(r);
			t.start();
		}
		if ("open dwarf list".equals(e.getActionCommand())) {
			DwarfListWindow listWindow = new DwarfListWindow(dwarfList);
			listWindow.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
			listWindow.setVisible(true);
		}
	}