Enumeration equip = entity.getMisc(); while ( equip.hasMoreElements() ) { Mounted mount = (Mounted) equip.nextElement();
for (Mounted mount : entity.getMisc()) {
    public MineLayingDialog( Frame parent, Entity entity ) {        super(parent, Messages.getString("MineLayingDialog.title"), true); //$NON-NLS-1$        this.entity = entity;        labMessage = new AdvancedLabel(Messages.getString("MineLayingDialog.selectMineToLay",new Object[]{entity.getDisplayName()})); //$NON-NLS-1$         // Walk through the entity's misc equipment, looking for mines.        Enumeration equip = entity.getMisc();        while ( equip.hasMoreElements() ) {            Mounted mount = (Mounted) equip.nextElement();            // Is this a Mine that can be layed?            if ( mount.getType().hasFlag(MiscType.F_MINE) && mount.canFire() ) {                StringBuffer message = new StringBuffer();                message.append( entity.getLocationName(mount.getLocation()) )                    .append( " " ) //$NON-NLS-1$                    .append( mount.getDesc() );                chMines.add(message.toString());                vMines.addElement(entity.getEquipmentNum(mount));                            } // End found-mine        } // Look at the next piece of equipment.        // buttons        butOkay.addActionListener(this);        butCancel.addActionListener(this);                // layout        GridBagLayout gridbag = new GridBagLayout();        GridBagConstraints c = new GridBagConstraints();        setLayout(gridbag);                    c.fill = GridBagConstraints.BOTH;        c.insets = new Insets(10, 10, 10, 10);        c.weightx = 1.0;    c.weighty = 0.0;        c.gridwidth = GridBagConstraints.REMAINDER;        gridbag.setConstraints(labMessage, c);        add(labMessage);                    gridbag.setConstraints(chMines, c);        add(chMines);        // Allow the player to confirm or abort the choice.        add(butOkay);        add(butCancel);        butOkay.requestFocus();                addWindowListener(new WindowAdapter() {        public void windowClosing(WindowEvent e) { setVisible(false); }    });                pack();        Dimension size = getSize();        boolean updateSize = false;        if ( size.width < GUIPreferences.getInstance().getMinimumSizeWidth()) {            size.width = GUIPreferences.getInstance().getMinimumSizeWidth();        }        if ( size.height < GUIPreferences.getInstance().getMinimumSizeHeight() ) {            size.height = GUIPreferences.getInstance().getMinimumSizeHeight();        }        if ( updateSize ) {            setSize( size );            size = getSize();        }        setResizable(false);        setLocation(parent.getLocation().x + parent.getSize().width/2 - size.width/2,                    parent.getLocation().y + parent.getSize().height/2 - size.height/2);    }