@Override
	public void paint(JComponent c, Graphics g, PaintContext context,
			Rectangle clip, FieldBackgroundColorManager colorManager, RowColLocation cursorLoc,
			int rowHeight) {
		if (context.isPrinting()) {
			print(g, context);
			return;
		}

		int cursorTextOffset = -1;
		int cursorRow = -1;
		if (cursorLoc != null) {
			cursorTextOffset = screenLocationToTextOffset(cursorLoc.row(), cursorLoc.col());
			cursorRow = cursorLoc.row();
		}

		Highlight[] highlights = hlFactory.createHighlights(this, getText(), cursorTextOffset);
		int columns = 0;
		int n = subFields.size();

		// the graphics have been translated such that the first line of text's base line is
		// at y=0  (So if we are not clipped, we will drawing from negative the fonts height above
		// the baseline (-heightAbove) to rowHeight -heightAbove
		int myStartY = -heightAbove;
		int myEndY = myStartY + rowHeight;
		int clipStartY = clip.y;
		int clipEndY = clip.y + clip.height;

		Color fieldBackgroundColor = colorManager.getBackgroundColor();
		if (fieldBackgroundColor != null) {
			g.setColor(fieldBackgroundColor);

			// restrict background rectangle to clipping rectangle
			int startY = Math.max(myStartY, clipStartY);
			int endY = Math.min(myEndY, clipEndY);
			int clippedHeight = endY - startY;
			g.fillRect(startX, startY, width, clippedHeight);
		}

		int startY = myStartY;
		int translatedY = 0;
		int extraSpace = rowSeparator.length();
		for (int i = 0; i < n; i++) {
			ClippingTextField subField = (ClippingTextField) getField(i);
			int subFieldHeight = subField.getHeight();
			int endY = startY + subFieldHeight;

			// if past clipping region we are done
			if (startY > clipEndY) {
				break;
			}

			// if any part of the line is in the clip region, draw it
			if (endY >= clipStartY) {
				// translate the highlights
				for (Highlight highlight : highlights) {
					highlight.setOffset(-columns);
				}
				subField.paintSelection(g, colorManager, i, rowHeight);
				subField.paintHighlights(g, highlights);
				subField.paintText(c, g, context);
				if (cursorRow == i) {
					subField.paintCursor(g, context.getCursorColor(), cursorLoc);
				}
			}

			// translate for next row of text
			startY += subFieldHeight;
			g.translate(0, subFieldHeight);
			translatedY += subFieldHeight;
			columns += subField.getText().length() + extraSpace;
		}

		// restore the graphics to where it was when we started.
		g.translate(0, -translatedY);
	}
This constructor will create a text field from an array of FieldElements, putting each
element on its own line.

@param textElements the FieldElements to display
@param startX  the x position to draw the element
@param width   the max width allocated to this field
@param maxLines the max number of lines to display
@param hlFactory the highlight factory
@param rowSeparator The string used to space lines of text when concatenated by the
       getText() method.
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/field/VerticalLayoutTextField.java