FileDocCategorySizeDatePackage
ChatApplet.javaAPI DocExample5527Mon Oct 16 19:44:06 BST 2000None

ChatApplet

public class ChatApplet extends Applet implements ActionListener

Fields Summary
private Chatter
client
private TextField
alias
Constructors Summary
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent e)
A one-shot event handler. Sole purpose is to get an alias from the user and get the client connected The TextField is blanked by removing it from the applet The action events are also cancelled The client has a controlling thread started if the connection is successful

  remove(alias);
      if( client.connect( alias.getText() ) )
      {  alias.removeActionListener( this );
         new Thread( client ).start();
      }
   
public voidinit()

  setLayout( new BorderLayout() );
      client= new Chatter( getDocumentBase().getHost() );
      add( client, BorderLayout.CENTER );
   
public voidstart()


                                               /**/
     add( alias, BorderLayout.SOUTH );
      alias.addActionListener( this );
      client.init();
   
public voidstop()

  client.disconnect();