private int getNumElements(DataType dt, int maxElements, int initial) {
		NumberInputDialog dialog =
			new NumberInputDialog(dt.getDisplayName() + " Elements", initial, 1, maxElements);

		if (!dialog.show()) {
			return 0;  // cancelled
		}

		return dialog.getValue();
	}
Get the number of elements to create from the user.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/CreateArrayAction.java