📄 doublebufferedclipped.java
字号:
import java.awt.*;public class DoubleBufferedClipped extends Clipped { Image offScreenImage; Graphics offScreenGC; public void update( Graphics g ) { if ( offScreenImage == null ) { offScreenImage = createImage( getSize().width, getSize().height ); offScreenGC = offScreenImage.getGraphics(); } int lastX = currentX, lastY = currentY; currentX = nextX; currentY = nextY; clipToAffectedArea( offScreenGC, lastX, lastY, currentX, currentY, imgWidth, imgHeight ); clipToAffectedArea( g, lastX, lastY, currentX, currentY, imgWidth, imgHeight ); paint( offScreenGC ); g.drawImage(offScreenImage, 0, 0, this); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -