home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / in4wjcxu / src / como / commlet / messagelog / messagelog.java
Encoding:
Java Source  |  1996-08-14  |  852 b   |  53 lines

  1. package como.commlet.messagelog;
  2.  
  3. import java.awt.*;
  4. import como.sys.*;
  5. import como.util.*;
  6. import como.commlet.*;
  7.  
  8. public class MessageLog extends WindowCommlet
  9.  
  10. {
  11.  
  12.     TextArea msgta;
  13.  
  14.     public MessageLog()
  15.     {
  16.     }
  17.  
  18.     public String getComletName()
  19.     {
  20.         return("MessageLog");
  21.     }
  22.  
  23.     public String getComletInfo()
  24.     {
  25.         return("MessageLog, V 1.0, Jan Kautz & Ulrich Gall");
  26.     }
  27.  
  28.     public void init()
  29.     {
  30.         super.init();
  31.         msgta = new TextArea();
  32.         msgta.setEditable(false);
  33.         add("Center",msgta);
  34.         resize(640,480);
  35.         pack();
  36.         print(getComletName());
  37.         print(getComletInfo());
  38.         print("Ready, waiting for messages...");
  39.     }
  40.  
  41.     void print(String s)
  42.     {
  43.         msgta.insertText(s+"\n",msgta.getText().length());
  44.     }
  45.  
  46.     public boolean handleMsg(Msg msg)
  47.     {
  48.         // Do not call super....
  49.         print(msg.toString());
  50.         return false; // since this "handling" does not really count
  51.     }
  52. }
  53.