while (failedUnits.hasMoreElements()) { failedList.add(failedUnits.nextElement().toString()); }
failedList.setSelectedIndex(0);
    public UnitFailureDialog(JFrame frame, Hashtable hff) {        super(frame, Messages.getString("UnitFailureDialog.title")); //$NON-NLS-1$        hFailedFiles = hff;        Enumeration failedUnits = hFailedFiles.keys();        reasonTextArea.setEditable(false);        failedList.addItemListener(this);        getContentPane().setLayout(new BorderLayout());        getContentPane().add(failedList, BorderLayout.NORTH);        getContentPane().add(new JScrollPane(reasonTextArea), BorderLayout.CENTER);        setSize(400, 300);        setLocation(frame.getLocation().x + frame.getSize().width / 2 - getSize().width / 2,                frame.getLocation().y + frame.getSize().height / 2 - getSize().height / 2);        JButton okButton = new JButton(Messages.getString("Okay")); //$NON-NLS-1$        okButton.addActionListener(this);        getContentPane().add(okButton, BorderLayout.SOUTH);        while (failedUnits.hasMoreElements()) {            failedList.add(failedUnits.nextElement().toString());        }        failedList.select(0);        reasonTextArea.setText(hFailedFiles.get(failedList.getSelectedItem()).toString());        setVisible(true);        failedList.makeVisible(0); // why are you fighting me java?        failedList.addKeyListener(this);        reasonTextArea.addKeyListener(this);        addWindowListener(new WindowAdapter() {            public void windowClosing(WindowEvent we) {                setVisible(false);            }        });    }