画上背景和坦克

背景知识Component类提供了和绘图有关的三个方法分别是 paint(Graphicsg)  而paint()方法在加载窗口时会被自动调用 update(Graphicsg) repaint() 调用repaint()可以实现绘图的更新,repaint会先调用update()方法,而update()方法会调用paint()方法实现图像的重绘 在原来的代码中添加如下的代码(红色为添加的代码) i
相关文章
相关标签/搜索