private static Object dialog(WindowType window, MessageType messageType,
                                 String title, String message, JFrame parent) {
        int swingType;
        switch (messageType) {
            case WARN:
                swingType = JOptionPane.WARNING_MESSAGE; break;
            case QUESTION:
                swingType = JOptionPane.QUESTION_MESSAGE; break;
            default:
                swingType = JOptionPane.ERROR_MESSAGE;
        }

        if ( window.equals(WindowType.MESSAGE) ) {
            JOptionPane.showMessageDialog(parent, message, title, swingType);
        } else if ( window.equals(WindowType.CONFIRM) ) {

            Object[] options = {"Ano", "Ne"};
            int button = JOptionPane.showOptionDialog(parent, message, title,
                        JOptionPane.YES_NO_OPTION, swingType, null, options, options[0]);
            return button == 0;

        } else if ( window.equals(WindowType.INPUT) ) {
            return JOptionPane.showInputDialog(parent, message, title, swingType);
        }

        return null;
    }