home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-02-08 | 606 b | 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;
- }
- }
-