/**
* 双缓冲技术解决窗口闪烁
*/
private int width;//窗口的宽
private int height;//窗口的高
private Image offScreenImage=null;
public void update(Graphics graphics){
if(offScreenImage==null){
offScreenImage=this.createImage(width,height);
}
Graphics gOff=offScreenImage.getGraphics();
paint(gOff);
graphics.drawImage(offScreenImage,0,0,null);
}
* 双缓冲技术解决窗口闪烁
*/
private int width;//窗口的宽
private int height;//窗口的高
private Image offScreenImage=null;
public void update(Graphics graphics){
if(offScreenImage==null){
offScreenImage=this.createImage(width,height);
}
Graphics gOff=offScreenImage.getGraphics();
paint(gOff);
graphics.drawImage(offScreenImage,0,0,null);
}