private void paintExceptionInLayout(Graphics g, Rectangle r, AnchoredLayout layout,
			Exception e) {
		Color defaultBackgroundColor = backgroundColorModel.getDefaultBackgroundColor();
		g.setColor(defaultBackgroundColor);
		g.fillRect(r.x, layout.getYPos() - layout.getHeight(), r.width, layout.getHeight());
		g.setColor(Messages.ERROR);
		GraphicsUtils.drawString(this, g, "Error Painting Field", r.x, layout.getYPos());
		Msg.error(this, "Unexpected Exception: " + e.getMessage(), e);
	}
Returns the offset of the cursor from the top of the screen

@return the offset of the cursor from the top of the screen
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/FieldPanel.java