private boolean addRange(String rangeText) {

		String trimmed = rangeText.trim();
		if (!trimmed.contains(RANGE_DELIMITER)) {
			try {
				int intValue = NumericUtilities.parseInt(trimmed);
				rangeList.addRange(intValue, intValue);
			}
			catch (NumberFormatException e) {
				setStatusText("Unable to parse as a number: '" + trimmed + "'");
				return false;
			}
			return true;
		}

		// this must be a range
		String[] startAndEnd = trimmed.split(RANGE_DELIMITER);
		try {
			int startInt = NumericUtilities.parseInt(startAndEnd[0]);
			int endInt = NumericUtilities.parseInt(startAndEnd[1]);
			rangeList.addRange(startInt, endInt);
		}
		catch (NumberFormatException e) {
			setStatusText("Unable to parse as a number: '" + trimmed + "'");
			return false;
		}
		return true;
	}
<code>show</code> displays the dialog, gets the user input

@return false if the user cancelled the operation
Ghidra/Framework/Docking/src/main/java/docking/widgets/dialogs/NumberRangeInputDialog.java