home *** CD-ROM | disk | FTP | other *** search
/ PDA Software Library / pdasoftwarelib.iso / PILOT / PC / JUMP / HELLO / HELLO.JAV < prev    next >
Encoding:
Text File  |  1996-12-27  |  959 b   |  43 lines

  1. import palmos.*;
  2.  
  3. class Hello {
  4.   static final int idfMain = 1000;
  5.  
  6.   public static int PilotMain(int cmd, int cmdBPB, int launchFlags)
  7.   {
  8.     if (cmd != 0) {
  9.       return 0;
  10.     }
  11.  
  12.     Palm.FrmGotoForm(idfMain);
  13.  
  14.     Event e = new Event();
  15.     Short err = new Short();
  16.     while (e.eType != Event.appStopEvent) {
  17.       Palm.EvtGetEvent(e, -1);
  18.       if (!Palm.SysHandleEvent(e)) {
  19.         if (!Palm.MenuHandleEvent(0, e, err)) {
  20.           if (!appHandleEvent(e)) {
  21.             Palm.FrmHandleEvent(Palm.FrmGetActiveForm(), e);
  22.           }
  23.         }
  24.       }
  25.     }
  26.  
  27.     return 0;
  28.   }
  29.  
  30.   static boolean appHandleEvent(Event e)
  31.   {
  32.     if (e.eType == Event.frmLoadEvent) {
  33.       int form = Palm.FrmInitForm(e.formID());
  34.       Palm.FrmSetActiveForm(form);
  35.       return true;
  36.     } else if (e.eType == Event.frmOpenEvent) {
  37.       Palm.FrmDrawForm(Palm.FrmGetActiveForm());
  38.       return true;
  39.     }
  40.     return false;
  41.   }
  42. }
  43.