private BigInteger computeValueFromString(String text, boolean parseAsHex) {
		if (text.isEmpty() || isValidPrefix(text)) {
			return null;
		}

		if (!parseAsHex) {
			return new BigInteger(text, 10);
		}

		if (allowsHexPrefix) {
			if (text.startsWith("0x")) {
				text = text.substring(2);
			}
			else if (text.startsWith("-0x")) {
				text = "-" + text.substring(3);
			}
		}
		if (text.isEmpty()) {
			return null;
		}
		return new BigInteger(text, 16);
	}
Sets the horizontal alignment of the JTextField

@param alignment the alignment as in {@link JTextField#setHorizontalAlignment(int)}
Ghidra/Framework/Docking/src/main/java/docking/widgets/textfield/IntegerTextField.java