public static void main(String[] args) {
			JDialog dialog = new JDialog((Window) null, "MultiTextField with Autocompleter Demo");

			Box hbox = Box.createHorizontalBox();
			dialog.add(hbox);

			TextFieldLinker dual = TextFieldLinker.twoSpacedFields();

			hbox.add(dual.getField(0));
			hbox.add(Box.createHorizontalStrut(10));
			hbox.add(dual.getField(1));

			dual.setVisible(true);

			AutocompletionModel<String> model = new AutocompletionModel<>() {
				Set<String> strings =
					new HashSet<>(Arrays.asList(new String[] { "Test", "Testing", "Another",
						"Yet another", "Yet still more", "Yet still even more", "Yetis, yo" }));

				@Override
				public Collection<String> computeCompletions(String text) {
					Set<String> matching = new TreeSet<>();
					for (String s : strings) {
						if (s.startsWith(text)) {
							matching.add(s.substring(text.length()));
						}
					}
					return matching;
				}
			};
			TextFieldAutocompleter<String> auto = new TextFieldAutocompleter<>(model) {
				@Override
				protected String getPrefix(JTextField field) {
					return dual.getTextBeforeCursor(field);
				}
			};

			auto.attachTo(dual.getField(0));
			auto.attachTo(dual.getField(1));

			dialog.setBounds(2560, 500, 400, 200);
			dialog.setModal(true);
			dialog.setVisible(true);
		}
A demonstration of the autocompleter on two linked text fields.

<p>
This demo was designed to test whether the autocompleter and the {@link TextFieldLinker}
could be composed correctly.
Ghidra/Framework/Docking/src/main/java/docking/widgets/autocomplete/TextFieldAutocompleter.java