import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class MeinApplet extends Applet { TextField eingabe; Label ausgabe; public void init() { Label hinweis = new Label( "Oben Text eingeben" ); eingabe = new TextField( " " ); ausgabe = new Label(); setLayout( new BorderLayout() ); add( BorderLayout.NORTH, eingabe ); add( BorderLayout.CENTER, hinweis ); add( BorderLayout.SOUTH, ausgabe ); eingabe.addActionListener( new ActionListener() { public void actionPerformed( ActionEvent ev ) { meineMethode(); } } ); } void meineMethode() { ausgabe.setText( "Der Text lautet: " + eingabe.getText() ); } }