home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Component;
- import java.awt.Font;
- import java.awt.Graphics;
-
- public class ThreadApplet2 extends Applet {
- MyThread thread;
- String displayStr;
- Font font;
-
- public void start() {
- this.font = new Font("TimesRoman", 0, 72);
- ((Component)this).setFont(this.font);
- this.displayStr = "";
- this.thread = new MyThread(this);
- this.thread.start();
- }
-
- public void stop() {
- this.thread.stop();
- }
-
- public void paint(Graphics var1) {
- var1.drawString(this.displayStr, 50, 150);
- }
- }
-