利用双缓冲的解决JAVA窗口闪烁问题
private Image offScreenImage=null;
public void update(Graphics g) {//update自动调用
if (offScreenImage==null) {
offScreenImage=this.createImage(Constant.GAME_WEIGHT,Constant.GAME_HEIGHT);
}
Graphics gOffGraphics=offScreenImage.getGraphics();
paint(gOffGraphics);
g.drawImage(offScreenImage, 0, 0, null);
}