if(offScr == null) { createBuffer(); }  Graphics offG = offScr.getGraphics();  offG.setClip(0, 0, getSize().width, getSize().height);  clearGraphics(offG);  Enumeration enum = bgDrawers.elements(); while(enum.hasMoreElements()){ BackGroundDrawer bgd = (BackGroundDrawer) enum.nextElement(); bgd.drawInto(offG, getSize().width, getSize().height); }
createBuffer();  Graphics offG = offScr.getGraphics();  offG.setClip(0, 0, getSize().width, getSize().height);  clearGraphics(offG);  Enumeration enum = bgDrawers.elements(); while(enum.hasMoreElements()){ BackGroundDrawer bgd = (BackGroundDrawer) enum.nextElement(); bgd.drawInto(offG, getSize().width, getSize().height); }
     public void paint(Graphics g) {	  // create and off-screen image if needed.	  if(offScr == null) {	       createBuffer();	  }	  // Get a Graphics object to draw with.	  Graphics offG = offScr.getGraphics();	  // set clipping to current size.	  offG.setClip(0, 0, getSize().width, getSize().height);	  // Clear the panel as needed 	  clearGraphics(offG);	  //Draw background	  Enumeration enum = bgDrawers.elements();       while(enum.hasMoreElements()){          BackGroundDrawer bgd = (BackGroundDrawer) enum.nextElement();          bgd.drawInto(offG, getSize().width, getSize().height);      }