home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java by Example
/
jbecd.bin
/
JBE-CD
/
NTUsers
/
JBECODE.ZIP
/
JavaByExample
/
chap31
/
ThreadApplet2.java
< prev
next >
Wrap
Text File
|
1996-03-21
|
549b
|
33 lines
import java.awt.*;
import java.applet.*;
import MyThread;
public class ThreadApplet2 extends Applet
{
MyThread thread;
String displayStr;
Font font;
public void start()
{
font = new Font("TimesRoman", Font.PLAIN, 72);
setFont(font);
displayStr = "";
thread = new MyThread(this);
thread.start();
}
public void stop()
{
thread.stop();
}
public void paint(Graphics g)
{
g.drawString(displayStr, 50, 150);
}
}