Buff.java (cont’d)
public void paint (Graphics g) {
// is this the first time we are painting?
if (startOut){ curD = getSize();
osImg = createImage (curD.width, curD.height);
osG = osImg.getGraphics();
// has the component been resized?
if ((curD.width != size().width) || (curD.height != size().height))
osImg = createImage (curD.width, curD.height);
osG = osImg.getGraphics();