这类方法是不建议使用的 通常在JAVADOC中有注明用哪一类方法替代

解决方案 »

  1.   

    jdkjava.lang.Thread
    stop() 
              Deprecated. This method is inherently unsafe. Stopping a thread with Thread.stop causes it to unlock all of the monitors that it has locked (as a natural consequence of the unchecked ThreadDeath exception propagating up the stack). If any of the objects previously protected by these monitors were in an inconsistent state, the damaged objects become visible to other threads, potentially resulting in arbitrary behavior. Many uses of stop should be replaced by code that simply modifies some variable to indicate that the target thread should stop running. The target thread should check this variable regularly, and return from its run method in an orderly fashion if the variable indicates that it is to stop running. If the target thread waits for long periods (on a condition variable, for example), the interrupt method should be used to interrupt the wait. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
      

  2.   

    ok,我把问题详细的写一下。
    是关于在同一页面的两个APPLET通信的问题。
    echoapplet1:
    import java.applet.Applet;
    import java.awt.*;public class echoapplet1 extends Applet
    {
        private TextField inputField = new TextField("Type in me!");
      
        public void init()
          {
      setLayout(new FlowLayout());   add(inputField);
      Button sendButton = new Button("Send");
      add(sendButton);
          }    public boolean action(Event evt, Object arg)
          {
      if (arg.equals("Send"))
        {
    Applet receiver = getAppletContext().getApplet("echoapplet2");
    if (receiver == null)
      System.out.println("echoapplet2 not found");
    else
      ((echoapplet2)receiver).setMessage(inputField.getText()); return true;
        }
      return super.action(evt, arg);
          }    public void setMessage(String newMessage)
          {
      inputField.setText(newMessage);
          }
    }echoapplet2:
    import java.applet.Applet;
    import java.awt.*;public class echoapplet2 extends Applet
    {
        private TextField inputField = new TextField("Type in me!");
      
        public void init()
          {
      setLayout(new FlowLayout());   add(inputField);
      Button sendButton = new Button("Send");
      add(sendButton);
          }    public boolean action(Event evt, Object arg)
          {
      if (arg.equals("Send"))
        {
    Applet receiver = getAppletContext().getApplet("echoapplet1");
    if (receiver == null)
      System.out.println("echoapplet1 not found");
    else
      ((echoapplet1)receiver).setMessage(inputField.getText()); return true;
        }
      return super.action(evt, arg);
          }    public void setMessage(String newMessage)
          {
      inputField.setText(newMessage);
          }
    }编译无法通过,提示deprecated methods。我以前从来没看过这方面的书,所以请教一下大家。