1 package bookExamples.ch26Graphics.draw2d; 2 3 import java.awt.*; 4 5 abstract class Shape extends Component 6 implements Paintable { 7 public void erase(Frame f, Graphics g) { 8 g.setXORMode(f.getBackground()); 9 paint(g); 10 g.setColor(f.getForeground()); 11 g.setPaintMode(); 12 } 13 }