在随机位置绘制点
import java.awt.Graphics; import javax.swing.JComponent;// from nowjava - 时代Java public class Main extends JComponent implements Runnable { Thread t; public void init() { t = new Thread(this); t.start(); } public void run() { try { while (true) { Thread.sleep(200); } } catch (Exception e) {//来自 n o w j a v a . c o m - 时 代 Java } } public void update(Graphics g) { paint(g); } public void paint(Graphics g) { int x = (