Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个需要通过调用移动的图像:
int Y = 100; Graphics g = Canvas().getGraphics(); //Canvas is a Java 3D Canvas 3D g.drawImage(Image, 400, Y, Canvas);
我还有一个移动图像的 keylistener,但是每当图像移动时,它都会留下一连串图像。有没有什么办法解决这一问题?
您的问题中遗漏了许多重要信息,迫使我们猜测,这不是一件好事。我的猜测:如果你是在paint(...)orpaintComponent(...)方法中绘制这个,那么你必须首先调用 super 方法。
paint(...)
paintComponent(...)