Topic: 当出现cannot resolve symbol这个错误时一般要如何处理?

  Print this page

1.当出现cannot resolve symbol这个错误时一般要如何处理? Copy to clipboard
Posted by: m00nsun
Posted on: 2004-09-03 11:25

/*=========================================
*  Created :wbb
*  2004-09-02
*  要求string 为六位数,左边空白的补满零。
*  例如:
**  int i=1 ====> string s="000001"
*  int i=101 ====> string s="000101"
*========================================*/

import java.awt.*;
import java.applet.*;
import java.text.DecimalFormat;

public class CodeId extends Applet{
  TextField t = new TextField(10);
  Button b1 = new Button("转换成编号");
  TextField idt = new TextField(10);
  String s = "";
  
  public void init(){
    add(t);
    add(b1);
    add(idt);
  }
  
  public boolean action(Event evt, Object arg){
    s = t.getText();
    DecimalFormat s = new DecimalFormat( "0000" );
    if (evt.target.equals(b1)){
        idt.setText(s);
    }
    else{
      return super.action(evt, arg);
    }
    return true;    
  }

}

//<applet code = CodeId.class width = 100 height = 100></applet>

2.Re:当出现cannot resolve symbol这个错误时一般要如何处理? [Re: m00nsun] Copy to clipboard
Posted by: zerol
Posted on: 2004-09-03 12:35

declare/define the variable or function indicated by the Exception.

3.Re:当出现cannot resolve symbol这个错误时一般要如何处理? [Re: m00nsun] Copy to clipboard
Posted by: m00nsun
Posted on: 2004-09-03 16:45

如何定义?
可否以我上面的例子为例讲一下应该怎么写?

4.Re:当出现cannot resolve symbol这个错误时一般要如何处理? [Re: m00nsun] Copy to clipboard
Posted by: yangmin9702
Posted on: 2004-09-03 17:30

少加了一个包
import java.awt.event.*;


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923