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

public class Applet1 extends Applet
{
  private TextField inputText = new TextField( "", 10 );
  public void init()
  {
    add( inputText );
    add( new Button( "Sende an Applet2" ) );
  }

  public boolean action( Event ev, Object arg )
  {
    if ( ev.target instanceof Button )
    {
      Applet2 applet2 = (Applet2) getAppletContext().getApplet( "applet2" );

      if ( applet2 != null )
      {
        applet2.appendTheText( inputText.getText().trim() );
        return true;
      }
    }
    return false;
  }

  public static void main(String args[]) {
      Frame f = new Frame("Line1");
      Applet1 line = new Applet1();
      f.add("Center", line);
     	f.setSize(300,300);
    	f.setVisible(true);
    }

}