Buff.java (cont’d)
osG.setColor(Color.gray);
osG.fillRect(0,0,size().width, size().height);
for (i=0; i< MAX; i++){ osG.setColor(b[i].c);
osG.fillOval(b[i].x,b[i].y, 10,10);
b[i].x+=b[i].dx; b[i].y+=b[i].dy;
if (b[i].x>= getSize().width-10 || b[i].x <=10)
if (b[i].y>= getSize().height-10 || b[i].y <=10)
g.drawImage (osImg,0,0,this); repaint(); }
public void update(Graphics g)