public boolean action(Event evt, Object arg)
  {int hit;

   if (arg.equals("Load Pattern"))
     {
 //       patc=0;
//        clearHistory();
//        readPattern(pattern_filename.getText());
//        //dumpPattern();
    }
   else if (arg.equals("Train"))
    {
//      int cc=toInt(epochs.getText());
//      System.out.println("* Training Epoch Started ["+cc+" steps] *");
//      train(cc);
//      double err=testPattern();
//      System.err.println( "* Epoch Done *");
//      cv.repaint();

    }
   else if (arg.equals("Make Network from Pattern"))
    {
    System.err.println("Making a new network for "+pattern_filename.getText());
    netFromPattern(pattern_filename.getText());
    //dumpPattern();
    //cv.repaint();
    System.err.println("Made a new network for "+pattern_filename.getText()+" and loaded the patterns.");
    }
   else if (arg.equals("Make Network from Weight"))
    {
     System.err.println("Making a new network from the weight file "+weight_filename.getText());
     netFromWeight(weight_filename.getText());
     //     cv.repaint();
    }
   else if (arg.equals("Load Weight"))
    {
//       totalit=0;
//       System.err.println("Loading weights from "+weight_filename.getText());
//       clearHistory();
//       installWeight(weight_filename.getText()); 
//       cv.repaint();
    }
   else if (arg.equals("Generate Weight File"))
    {
//       System.err.println("Writing weight file "+weight_filename.getText());
//       writeWeight(weight_filename.getText());
    }
    else if (arg.equals("Randomize Weights"))
    {
 //      initNet();
    }

   else if (arg.equals("Test"))
    {
  //    double terr=testPattern();
    }
    else if (arg.equals("QUIT"))
    {
      System.exit(0);
    }
   else return super.action(evt,arg);
   return true;
 }