你难道不会看它的帮助文档么?
我想那里已经解释的比较详细了吧。
要想快速做一个配置程序,你就用Web NMS的BeanBuilder或者Adventnet的Management Builder来做

解决方案 »

  1.   

    package event;import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import com.borland.jbcl.layout.*;
    import com.borland.jbcl.control.*;
    import javax.swing.*;public class Applet1 extends Applet implements TimerListener
    {
      XYLayout xYLayout1 = new XYLayout();
      boolean isStandalone = false;  TimerBean timer=new TimerBean();
      JTextField jTextField1 = new JTextField();
      //Construct the applet
      public Applet1()
      {
      }  //Initialize the applet
      public void init()
      {
        try
        {
          jbInit();
        }
        catch(Exception e)
        {
          e.printStackTrace();
        }
      }  //Component initialization
      private void jbInit() throws Exception
      {
        jTextField1.addActionListener(new java.awt.event.ActionListener()
        {      public void actionPerformed(ActionEvent e)
          {
            jTextField1_actionPerformed(e);
          }
        });
        xYLayout1.setWidth(400);
        xYLayout1.setHeight(300);
        this.setLayout(xYLayout1);
        timer.setRunning(true);
        timer.addTimerListener(this);
        this.add(jTextField1, new XYConstraints(94, 151, 170, -1));
      }  //Get Applet information
      public String getAppletInfo()
      {
        return "Applet Information";
      }  //Get parameter info
      public String[][] getParameterInfo()
      {
        return null;
      }  void jTextField1_actionPerformed(ActionEvent e)
      {  }
      public void timeElapsed(TimerEvent e)
      {
         System.out.println(e.getName());
         if(jTextField1.getText()!=null)
         jTextField1.setText(null);
        jTextField1.setText(e.getDate().toGMTString());
      }
    }
      

  2.   

    package event;import java.io.Serializable;
    import java.awt.*;
    import java.util.*;public class TimerBean implements Runnable, Serializable
    {
      private int interval = 1000;
      private Vector timerListeners = new Vector();
      private Thread runner;  public int getInterval(){return interval;}
      public void setInterval(int i){interval = i;}  public boolean isRunning(){return runner !=null;}
      public void setRunning(boolean b)
      {
        if(b&&runner == null)
        {
           runner = new Thread(this);
           runner.start();
        }
        else if (!b && runner !=null)
        {
           runner.interrupt();
           runner=null;
        }
      }  public synchronized void addTimerListener(TimerListener l)
      {
         timerListeners.addElement(l);
      }
      public synchronized void removeTimerListener(TimerListener l)
      {
         timerListeners.removeElement(l);
      }  public void fireTimerEvent(TimerEvent evt)
      {
         Vector currentListeners = null;
         synchronized(this)
         {
            currentListeners = (Vector)timerListeners.clone();
         }
         for(int i = 0; i<currentListeners.size();i++)
         {
            TimerListener listener = (TimerListener)currentListeners.elementAt(i);
            listener.timeElapsed(evt);
         }
      }  public void run()
      {
        //TODO: implement this java.lang.Runnable method;
        if(interval <=0) return;
        try
          {
            while(!runner.interrupted())
            {
              Thread.sleep(interval);
              fireTimerEvent(new TimerEvent(this));
            }
          }
          catch(InterruptedException e)
          {}
      }
    }
      

  3.   

    谢谢!sealing,xiazhihan,你们好,如果你们使用过这个工具,今后长交流如何?