public static void normalizeButtons(JButton[] buttons) {
        int maxWidth = 0;
        int maxHeight = 0;
        for (int a = 0; a < buttons.length; a++) {
            buttons[a].setPreferredSize(null);
            Dimension d = buttons[a].getPreferredSize();
            Number n = (Number) buttons[a].getClientProperty(DialogFooter.PROPERTY_OPTION);
            if (((n != null) && (n.intValue() == DialogFooter.DONT_SAVE_OPTION)) ||
                    (d.width > 80)) {
                buttons[a] = null;
            }
            if (buttons[a] != null) {
                maxWidth = Math.max(d.width, maxWidth);
                maxHeight = Math.max(d.height, maxHeight);
            }
        }
        for (JButton button : buttons) {
            if (button != null) {
                button.setPreferredSize(new Dimension(maxWidth, maxHeight));
            }
        }
    }