public static Integer numberInput(final JTextField inputField, final MainFrame mainFrame,
            final int min, final int max, final boolean zero) {
        
        Algorithms.notLessThanCheck(max, min);
        try {
            final String input = inputField.getText();
            final Integer result = Integer.parseInt(input);
            if ((result == 0) && !zero)
                throw new NumberFormatException("Zero is not allowed.");
            if ((result < min) || (result > max))
                throw new NumberFormatException("Invalid range.");
            inputField.setBackground(Color.white);
            return result;
        } catch (NumberFormatException ex) {
            final StringBuilder msg = new StringBuilder(32);
            msg.append("Prosím zadejte celé číslo v rozsahu [").append(min);
            msg.append(", ").append(max).append("].");
            msg.append(((min < 1) && (!zero)) ? " Nula není povolena." : "");
            error(inputField, mainFrame, msg.toString());
            return null;
        }
    }