dlg.show();
dlg.setVisible(true);
    private void brush() {        ToHitData toHitLeft = BrushOffAttackAction.toHit            ( client.game, cen, target, BrushOffAttackAction.LEFT );        ToHitData toHitRight = BrushOffAttackAction.toHit            ( client.game, cen, target, BrushOffAttackAction.RIGHT );        boolean canHitLeft  = (ToHitData.IMPOSSIBLE != toHitLeft.getValue());        boolean canHitRight = (ToHitData.IMPOSSIBLE != toHitRight.getValue());        int damageLeft = 0;        int damageRight = 0;        String  title = null;        StringBuffer    warn  = null;        String left  = null;        String right = null;        String both = null;        String[] choices = null;        SingleChoiceDialog dlg = null;        // If the entity can't brush off, display an error message and abort.        if ( !canHitLeft && !canHitRight ) {            clientgui.doAlertDialog( Messages.getString("PhysicalDisplay.AlertDialog.title"), //$NON-NLS-1$                                  Messages.getString("PhysicalDisplay.AlertDialog.message") ); //$NON-NLS-1$            return;        }        // If we can hit with both arms, the player will have to make a choice.        // Otherwise, the player is just confirming the arm in the attack.        if ( canHitLeft && canHitRight ) {            both = Messages.getString("PhysicalDisplay.bothArms"); //$NON-NLS-1$            warn = new StringBuffer(Messages.getString("PhysicalDisplay.whichArm")); //$NON-NLS-1$            title = Messages.getString("PhysicalDisplay.chooseBrushOff"); //$NON-NLS-1$        } else {            warn = new StringBuffer(Messages.getString("PhysicalDisplay.confirmArm")); //$NON-NLS-1$            title = Messages.getString("PhysicalDisplay.confirmBrushOff"); //$NON-NLS-1$        }        // Build the rest of the warning string.        // Use correct text when the target is an iNarc pod.        if (Targetable.TYPE_INARC_POD == target.getTargetType()) {            warn.append(Messages.getString("PhysicalDisplay.brushOff1",new Object[]{target})); //$NON-NLS-1$        }        else {            warn.append(Messages.getString("PhysicalDisplay.brushOff2")); //$NON-NLS-1$        }        // If we can hit with the left arm, get        // the damage and construct the string.        if ( canHitLeft ) {            damageLeft = BrushOffAttackAction.getDamageFor(ce(), BrushOffAttackAction.LEFT);            left = Messages.getString("PhysicalDisplay.LAHit", new Object[]{ //$NON-NLS-1$                    toHitLeft.getValueAsString(), new Double(Compute.oddsAbove(toHitLeft.getValue())), new Integer(damageLeft)});        }        // If we can hit with the right arm, get        // the damage and construct the string.        if ( canHitRight ) {            damageRight = BrushOffAttackAction.getDamageFor(ce(), BrushOffAttackAction.RIGHT);            right = Messages.getString("PhysicalDisplay.RAHit", new Object[]{ //$NON-NLS-1$                    toHitRight.getValueAsString(), new Double(Compute.oddsAbove(toHitRight.getValue())), new Integer(damageRight)});        }        // Allow the player to cancel or choose which arm(s) to use.        if ( canHitLeft && canHitRight ) {            choices = new String[3];            choices[0] = left.toString();            choices[1] = right.toString();            choices[2] = both.toString();            dlg = new SingleChoiceDialog                ( clientgui.frame, title, warn.toString(), choices );            dlg.show();            if ( dlg.getAnswer() ) {                disableButtons();                switch ( dlg.getChoice() ) {                case 0:                    attacks.addElement( new BrushOffAttackAction                        (cen, target.getTargetType(), target.getTargetId(), BrushOffAttackAction.LEFT) );                    break;                case 1:                    attacks.addElement( new BrushOffAttackAction                        (cen, target.getTargetType(), target.getTargetId(), BrushOffAttackAction.RIGHT) );                    break;                case 2:                     attacks.addElement( new BrushOffAttackAction                        (cen, target.getTargetType(), target.getTargetId(), BrushOffAttackAction.BOTH) );                    break;                }                ready();            } // End not-cancel        } // End choose-attack(s)        // If only the left arm is available, confirm that choice.        else if ( canHitLeft ) {            choices = new String[1];            choices[0] = left.toString();            dlg = new SingleChoiceDialog                ( clientgui.frame, title, warn.toString(), choices );            dlg.show();            if ( dlg.getAnswer() ) {                disableButtons();                attacks.addElement( new BrushOffAttackAction                    (cen, target.getTargetType(), target.getTargetId(), BrushOffAttackAction.LEFT) );                ready();            } // End not-cancel        } // End confirm-left        // If only the right arm is available, confirm that choice.        else if ( canHitRight ) {            choices = new String[1];            choices[0] = right.toString();            dlg = new SingleChoiceDialog                ( clientgui.frame, title, warn.toString(), choices );            dlg.show();            if ( dlg.getAnswer() ) {                disableButtons();                attacks.addElement( new BrushOffAttackAction                    (cen, target.getTargetType(), target.getTargetId(), BrushOffAttackAction.RIGHT) );                ready();            } // End not-cancel        } // End confirm-right    } // End private void brush()