private void renderComponent(DataTypeComponent dtc, int dtNameWidth, int fieldNameWidth,
			int offsetWidth) {
		String fieldName = dtc.getFieldName();
		if (fieldName == null) {
			fieldName = "";
		}
		String comment = dtc.getComment();
		if (comment == null) {
			comment = "";
		}
		offsetWidth += 2; // factor in 0x prefix
		String offsetStr = "";
		if (offsetWidth > 0) {
			offsetStr = "0x" + Integer.toHexString(dtc.getOffset());
			offsetStr = StringUtilities.pad(offsetStr, ' ', offsetWidth - offsetStr.length());
			offsetStr += ": ";
			insertString("  " + offsetStr + "  ", offsetAttrs);
		}
		fieldName = pad(fieldName, fieldNameWidth);
		String typeName = pad(getDataTypeName(dtc), dtNameWidth);

		insertString("    " + typeName + "  ", contentAttrs);
		insertString(fieldName + "   ", fieldNameAttrs);
		insertString(comment, commentAttrs);
		insertString("\n", contentAttrs);
	}
Panel to show the contents of a Data Type.
Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/DataTypePanel.java