home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 January / PCO0198.ISO / 1&1 / java.z / java_301 / java / awt / Canvas.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-10-20  |  943 b   |  14 lines

  1. package java.awt;
  2.  
  3. public class Canvas extends Component {
  4.    public synchronized void addNotify() {
  5.       super.peer = ((Component)this).getToolkit().createCanvas(this);
  6.       super.addNotify();
  7.    }
  8.  
  9.    public void paint(Graphics g) {
  10.       g.setColor(((Component)this).getBackground());
  11.       g.fillRect(0, 0, super.width, super.height);
  12.    }
  13. }
  14.