// Use Component.createImage to get you a blank image to draw on.
// Do this in your init method, not static init, or you will just get null.
Image img = createImage( width, height );
Graphics gi = img.getGraphics();

// Now use gi.drawString, gi.clearRect etc. to draw,
// just as you would on-screen graphics.
// That gives you an off-screen bit map of your image.
// To blast the image onto the screen in your paint routine use:
g.drawImage( img, x, y, /* image observer */ this );
// And override update to call paint without clearing first.