当前位置: 代码迷 >> Java相关 >> 求助一个小程序的错误
  详细解决方案

求助一个小程序的错误

热度:126   发布时间:2008-09-06 21:46:38.0
求助一个小程序的错误
import java.awt.*;
import java.applet.Applet;
public class caizimu extends Applet{
     Label prompt;        //prompt user to input.
     TextField input;        //input values here.
     int instr;       //store imput value.
     int comparestr;  //store target value.
     public void init(){
         prompt = new Label("Enter a small letter and press Enter:");
         input = new TextField(10);
         add(prompt);
         add(input);
         comparestr = 'a' + (int)( Math.random() * 26 );  //产生随机字母
     }
     public void paint ( Graphics g){
         g.drawString("The letter you entered is :",70,75);
         if(instr > comparestr){
            g.drawString("The letter you entered is bigger!",100,90);  
         }
         if(instr < comparestr){
            g.drawString("The letter you entered is smaller!",100,90);
         }
         if(instr == comparestr){
            g.drawString("The letter you entered is right one ! congratulations !",100,90);  
         }
     }
     public boolean action( Event e, Object o){
          instr = Integer.parseInt( o.toString() );
          if( instr != comparestr){
             repaint();
          }
          return true;
     }
}


我是在jdk1.6中运行的。可是提示caizimu.java使用或覆盖了已过时的API。提示还说要了解
详细信息。请用―Xlint:deprecation 重新编译。什么意思啊。怎么做啊。请高手指教。谢谢。。。。
搜索更多相关的解决方案: public  import  letter  target  values  

----------------解决方案--------------------------------------------------------
这个应该不时你自己些的把
这么古董的东西就搬出来啦
还时看看现在的东西把
----------------解决方案--------------------------------------------------------
  相关解决方案