I have an image on top of which I would like to write text that has multiple lines, is center-aligned, and dynamic (variable width). I\'ve tried using the drawString>
You should use a drawString().
To properly center a text you need to calculate the width for a given font:
Font font = getFont();
FontMetrics metrics = getFontMetrics( font );
int width = metrics.stringWidth( theString );
And remember to add -Djava.awt.headless=true if you want to call in on server (without GUI).