★
★蓝天★
Unregistered / Unconfirmed
GUEST, unregistred user!
void Button3_actionPerformed(ActionEvent e) {
Graphics g=getGraphics();
g.drawImage(image,20,40,this);
showStatus("显示图像");
}
void Button4_actionPerformed(ActionEvent e) {
Graphics g=getGraphics();
image.flush();
g.drawImage(image,20,40,this);
showStatus("关闭图像");
执行Button3_actionPerformed时,就能显示图像,执行Button4_actionPerformed时,就关闭图像.为什么Button4_actionPerformed能关闭图像,他也执行了g.drawImage(image,20,40,this);啊!!??那应该是image.flush()的问题,那这句话到底有何用呢
Graphics g=getGraphics();
g.drawImage(image,20,40,this);
showStatus("显示图像");
}
void Button4_actionPerformed(ActionEvent e) {
Graphics g=getGraphics();
image.flush();
g.drawImage(image,20,40,this);
showStatus("关闭图像");
执行Button3_actionPerformed时,就能显示图像,执行Button4_actionPerformed时,就关闭图像.为什么Button4_actionPerformed能关闭图像,他也执行了g.drawImage(image,20,40,this);啊!!??那应该是image.flush()的问题,那这句话到底有何用呢