public void init() {
fertig = false;  //开始准备
addMouseListener(this);  //Pressed, Released, Clicked
addMouseMotionListener(this);   //Draged, Motion
c1 = new Cursor(Cursor.WAIT_CURSOR);   //漏斗光标
c2 = new Cursor(Cursor.CROSSHAIR_CURSOR);   //十字标
x1 = getSize().width;    //window的宽
y1 = getSize().height;     //window的高
xy = (float)x1 / (float)y1;   //比例
bild = createImage(x1, y1);    //创缓冲在内存中的图
g1 = bild.getGraphics();    //得到graphice对象
fertig = true;   //准备完成
}之后,就是双缓冲画图了