private static String lookForTextInsideOfComponent(Component component) {
		if (!(component instanceof Container)) {
			return null;
		}
		Container container = (Container) component;
		Component[] components = container.getComponents();
		for (Component child : components) {
			if (child instanceof JLabel) {
				// check for a label with text (one without text could be used for an icon)
				JLabel label = (JLabel) child;
				String text = label.getText();
				if (text != null) {
					return text;
				}
			}
			else if (child instanceof JTextComponent) {
				// surely this is for displaying text
				JTextComponent textComponent = (JTextComponent) child;
				return textComponent.getText();
			}
		}

		return null;
	}
Attempts to get the text value for the cell so that the data will match what the user sees.
Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableToCSV.java