Simple Applet

You should see an applet above that allows you to type something into the textbox and then click on the button to copy it into the label.

The source code

import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public class ADemo2 extends Applet {
   Label lbl = new Label();
   TextField txt = new TextField();
   Button btn = new Button("Click Me!");

   public void init() {
      setLayout(new GridLayout(3,1,5,5));
      add(txt);
      add(lbl);
      add(btn);
      btn.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
            if (txt.getText().length() > 0) {
               lbl.setText(txt.getText());
               txt.setText("");
            }
         }
      });
   }
}