Why does getGraphics() return null on my offscreen image?
Ans : The following code class MyFrame extends Frame { MyFrame() { Image offscreen = createImage(100,100); Graphics offg = offscreen.getGraphics(); } … } will usually not work, since the peer will not exist at this time. Without the peer for the Frame, you cannot succeed in creating offscreen Images. (There’s no problem creating Produced Images without a peer. Trying to draw them, of course, is another matter). One “standard” form of offscreen code looks like this: (note the reuse of the Graphics and Image objects for as long as possible) class Gumble extends java.awt.Something { private Image offi; private Graphics offg; public void update(Graphics g) { if (g == null) return; // Paranoia Dimension size = size(); if ( offi == null || offi.getWidth()!=size.width || offi.getHeight()!=size.height ) { if (offg!=null) offg.dispose(); offi = createImage(size.width, size.height); offg = offi.getGraphics(); // Regenerate offi here… } // If you use getClipBounds() here, // check that for be