/**
     * java awt双缓冲技术  复制代码到显示区
     */
 Image offScreenImage = null;
    
    public void update(Graphics g) {
        if(offScreenImage == null) {
            offScreenImage = this.createImage(屏幕宽, 高);
        }
        Graphics gOffScreen = offScreenImage.getGraphics();
        Color c = gOffScreen.getColor();
        gOffScreen.setColor(Color.GREEN);
        gOffScreen.fillRect(0, 0,屏幕宽, 高);
        gOffScreen.setColor(c);
        paint(gOffScreen);
        g.drawImage(offScreenImage, 0, 0, null);
    }
    

 

相关文章:

  • 2022-01-11
  • 2021-08-09
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2021-08-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
相关资源
相似解决方案