|
Kleines Java-Applet das einen Text ausgibt.
import java.awt.*;
import java.applet.*;
public class Applet1 extends Applet {
TextField tf1 = new TextField(20);
TextField tf2 = new TextField(20);
TextArea ta1 = new TextArea(10,50);
public void start() {}
public void init() {
setBackground(Color.yellow);
add(tf1);
add(ta1);
add(tf2);
}
public void paint(Graphics g){
g.drawString("Hallo!", 20, 300);
}
public void stop() {}
public void destroy() {}
}
<html> <body> Test <applet code="Applet1.class" width="400" height="300" alt="Test-Applet"> </applet> </body> </html> |