import java.awt.*;
class Test extends Frame {
TextField txtName = new TextField(20);
Label lblName = new Label("名称:");
//文本域不可编辑
void setEditable(boolean txtName) {
txtName=false;
}
public Test(String title)
{
super(title);
setLayout(new FlowLayout());
add(lblName);
add(txtName);
}
public static void main(String[] args)
{
Test x = new Test("TEST");
x.setSize(300,100);
x.setVisible(true);
}
用了以上代码 文本域还是可以编辑
请教应该修改哪里
[此贴子已经被作者于2006-10-19 14:05:35编辑过]