private JComponent createDataTypeChoiceEditor() {

		dtChoiceEditor = new DataTypeSelectionEditor(composite.getDataTypeManager(), dtmService,
			AllowedDataTypes.BITFIELD_BASE_TYPE);
		dtChoiceEditor.setConsumeEnterKeyPress(false);
		dtChoiceEditor.setTabCommitsEdit(true);
		//dtChoiceEditor.setPreferredDataTypeManager(composite.getDataTypeManager());

		final DropDownSelectionTextField<DataType> dtChoiceTextField =
			dtChoiceEditor.getDropDownTextField();
		dtChoiceTextField.setBorder((new JTextField()).getBorder());

		dtChoiceEditor.addFocusListener(new FocusAdapter() {
			@Override
			public void focusLost(FocusEvent e) {
				Component other = e.getOppositeComponent();
				if (other == null) {
					// Focus lost to a different application
				}
				else if (SwingUtilities.isDescendingFrom(other, BitFieldEditorPanel.this)) {
					if (!SwingUtilities.isDescendingFrom(other,
						dtChoiceEditor.getEditorComponent())) {
						dtChoiceEditor.stopCellEditing();
					}
				}
			}
		});

		dtChoiceEditor.addCellEditorListener(new CellEditorListener() {
			@Override
			public void editingCanceled(ChangeEvent e) {
				dtChoiceEditor.setCellEditorValue(baseDataType); // restore
			}

			@Override
			public void editingStopped(ChangeEvent e) {
				if (!checkValidBaseDataType()) {
					dtChoiceTextField.selectAll();
					dtChoiceTextField.requestFocus();
				}
				else {
					updateBitSizeModel();
					NavigationDirection direction = dtChoiceEditor.getNavigationDirection();
					if (direction == NavigationDirection.FORWARD) {
						allocSizeInput.requestFocus();
					}
					else if (direction == NavigationDirection.BACKWARD) {
						bitOffsetInput.requestFocus();
					}
				}
			}
		});

		JComponent editorComponent = dtChoiceEditor.getEditorComponent();
		Dimension preferredSize = editorComponent.getPreferredSize();
		editorComponent.setPreferredSize(new Dimension(200, preferredSize.height));
		return editorComponent;
	}
<code>BitFieldEditorPanel</code> provides the ability to add or modify bitfields
within non-packed structures.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldEditorPanel.java