1 | import java.applet.*; |
2 | import java.awt.Graphics; |
3 | public class Hello extends Applet { |
4 | String str = "Hello, World"; |
5 | int x = 25; |
6 | int y = 25; |
7 | public void paint ( Graphics g){ |
8 | g.drawString ( str, x, y ); |
9 | } |
10 | public void setString ( String newstr ){ |
11 | str = newstr; |
12 | repaint(); |
13 | } |
14 | public String getString() { |
15 | return str; |
16 | } |