public static List<Integer> parse(final JTextField inputField,
            final MainFrame mainFrame, final int count) {
        
        try {
            final String input = inputField.getText();
            String[] tokens = removeWhiteSpace(input).split(","); // try to split on commas
            if (tokens.length != count) {
                tokens = input.split("\\s+"); // then on whitespace
                if (tokens.length != count)
                    throw new IllegalArgumentException("Invalid number of arguments.");
            }
            
            final List<Integer> result = new ArrayList<>();
            for (int i = 0; i < count; ++i) {
                final int number = Integer.parseInt(tokens[i]);
                result.add(number);
                if ((number < Config.MIN_INT) || (number > Config.MAX_INT))
                    throw new NumberFormatException("Invalid range.");
            }
            inputField.setBackground(Color.white);
            return result;
        } catch (IllegalArgumentException ex) {
            String msg;
            if (count == 0)
                msg = "Příklad nemá řešení.";
            else
                msg = "Prosím zadejte " + count + " celočíselné koeficienty oddělené mezerou.";
            error(inputField, mainFrame, msg.toString());
            return new ArrayList<>();
        }
    }