import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.*;public class MyJava1 {
public static void main(String[] args) {
Tank tn = new Tank();
tn.lauchJFrame();
}}class Tank extends JFrame {
private static final long serialVersionUID = 1L; public void lauchJFrame() {
this.setTitle("TankWar");
this.setSize(600, 500);
this.setLocation(500, 200);
this.getContentPane().setBackground(Color.BLUE);
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
this.setResizable(false);
setVisible(true);
new Thread(new PaintThread()).start();

} public void paint(Graphics g) {
int x = 50;
int y = 50;
Color c = g.getColor();
g.setColor(Color.red);
g.fillOval(x, 50, 30, 30);
g.setColor(c);
x += 4;
y += 4;
}

private class PaintThread implements Runnable { public void run() {
while(true) {
repaint();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}

}
}为什么图形出来了以后,它不移动啊,弄了很久都没有把问题找出来,希望大家帮帮忙啊