CHING 可否將此 Applet 轉為 Application
- import java.applet.Applet;
- import java.awt.*;
- import java.util.Random;
- public class A extends Applet
- implements Runnable
- {
- public void init()
- {
- }
-
- public boolean handleEvent(Event event)
- {
- ///
- return false;
- }
- public void start()
- {
- thread = new Thread(this);
- thread.start();
- }
- public void stop()
- {
- thread.stop();
- }
-
- public void run()
- {
- do
- {
- repaint();
- try
- {
- Thread.sleep(33L);
- }
- catch(InterruptedException _ex) { }
- } while(true);
- }
- public void update(Graphics g)
- {
- paint(g);
- }
- public void paint(Graphics g)
- {
- ///////////
- }
- private Thread thread;
- }
-
複製代碼 如果轉做 Application, 個 Program
個FLOW大概是怎樣?
THX |
|
|