private void createHostField() {

			hostField = new GFormattedTextField(FORMATTER_FACTORY, "");
			hostField.setName("Host");
			hostField.setText("");
			hostField.setDefaultValue("");
			hostField.setIsError(true);
			hostField.setEditable(true);

			hostField.setInputVerifier(new InputVerifier() {
				@Override
				public boolean verify(JComponent input) {
					setStatus("");
					String hostname = hostField.getText().trim();
					if (hostname.length() == 0) {
						setStatus("");
						return false;
					}
					Matcher hostMatch = HOSTNAME_IP_PATTERN.matcher(hostname);
					if (!hostMatch.matches()) {
						setStatus("Unsupported host name or IP address");
						return false;
					}
					return true;
				}

				@Override
				public boolean shouldYieldFocus(JComponent source, JComponent target) {
					return true;
				}
			});

			hostField.addKeyListener(new KeyAdapter() {
				@Override
				public void keyPressed(KeyEvent e) {
					if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
						e.consume();
						hostField.setText("");
						hostField.setDefaultValue("");
						hostField.setIsError(true);
					}
					checkForValidDialog();
				}
			});

			hostField.addTextEntryStatusListener(f -> checkForValidDialog());
		}
Dialog for entering new BSim database server definition
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/gui/search/dialog/CreateBsimServerInfoDialog.java