编译不报错  程序运行也没问题  但多了两个NOTENote: C:\JAVA\Proving Gound\T5.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.Process completed.这个到底是什么原因啊  以前从没碰到过  哪位高手帮帮忙指点一下  先谢过了

解决方案 »

  1.   

    好好好好  谢过  下面那就是import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;public class T5 extends JFrame {
    private Container ctn;
    private JPanel pnlS , pnlN;
    private JLabel lb;
    private static JTextField tf;
    private JButton btnStart , btnReset;
    private StartEvent seHandler;
    private ResetEvent reHandler;
    private CountDown cd;

    public T5() {
    ctn = getContentPane();
    pnlN = new JPanel();
    lb = new JLabel("Count Down : ");
    pnlN.add(lb);

    tf = new JTextField("" , 4);
    pnlN.add(tf);
    ctn.add(pnlN , BorderLayout.NORTH);

    pnlS = new JPanel(new GridLayout(1 , 2));
    btnStart = new JButton("Start");
    seHandler = new StartEvent();
    btnStart.addActionListener(seHandler);
    pnlS.add(btnStart);

    btnReset = new JButton("Reset");
    reHandler = new ResetEvent();
    btnReset.addActionListener(reHandler);
    pnlS.add(btnReset);
    ctn.add(pnlS , BorderLayout.SOUTH);
    pack();
    show();
    }

    private class StartEvent implements ActionListener {
    private int cdTime;

    public void actionPerformed(ActionEvent e) {
    tf.setEditable(false);
    cdTime = Integer.parseInt(tf.getText());
    cd = new CountDown(cdTime);
    cd.start();
    }
    }

    private class ResetEvent implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    cd.stop();
    tf.setEditable(true);
    tf.setText("");
    }
    }

    private class CountDown extends Thread {
    int time = 0;

    public CountDown(int time) {
    this.time = time - 1;
    }

    public void run() {
    try {
    for(int index = time ; index >= 0 ; index--) {
    Thread.sleep(1000);
    tf.setText("" + index);
    if(index == 0) {
    tf.setEditable(true);
    }
    }
    } catch(Exception e) {
    System.err.println(e.toString());
    }
    }
    }

    public static void main(String args[]) {
    T5 Arc1 = new T5();
    Arc1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
    }
      

  2.   

    The warning message says that you have used a method which has been replaced by new API method and currently is not encouraged to be used.Your program may still works fine on your machine.
      

  3.   

    那这个难道属于提示信息什么的阿  呵呵呵呵  先记下了
    Buy the way , midlet , are you a ABC or a foreigner or ....
      

  4.   

    说的很明显嘛,你使用了deprecated API,新的jdk不推荐使用,换个别的库函数再.