import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class string3 extends Applet implements TextListener{
Label lblMessage;
TextField txtText1;
String strString1="";
public void init(){
lblMessage=new Label("enter some words");
add(lblMessage);
txtText1.addTextListener(this);
}
public void paint(Graphics objG){
objG.drawString="strString 1,202,42";
}
public void textValueChanged(TextEvent objE){
strString1=txtText1.getText();
repaint();
}
}
cmd说
C:\sample java>javac string3.java string3.java:14: 找不到符号 symbol: 变量 drawString 位置: class java.awt.Graphics objG.drawString="strString 1,202,42";
1 个错误