home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java by Example
/
jbecd.bin
/
JBE-CD
/
NTUsers
/
JBECODE.ZIP
/
JavaByExample
/
chap11
/
Applet10.java
< prev
next >
Wrap
Text File
|
1996-02-08
|
606b
|
30 lines
import java.awt.*;
import java.applet.*;
public class Applet10 extends Applet
{
TextField textField1;
public void init()
{
textField1 = new TextField(20);
add(textField1);
textField1.setText("Moe Howard");
}
public void paint(Graphics g)
{
g.drawString("Enter a name above.", 70, 45);
String s = textField1.getText();
for (int x=0; x<10; ++x)
g.drawString(s, 80, x * 15 + 70);
}
public boolean action(Event event, Object arg)
{
repaint();
return true;
}
}