class Demo extends JFrame implements TextListener
{
JTextField text = new JTextField(15);
class Demo()
{
this.add(text);
this.addTextListener(this); // 有没有这个方法阿?监听文本区内容变化的应该是这个类吧,方法怎么写啊,这样写有错误
this.pack();
this.show();
} public void textValueChanged(TextEvent e)
{
System.out.println ("怎样写啊???");
}
public static void main(String s[])
{
new Demo();
}
}
{
JTextField text = new JTextField(15);
class Demo()
{
this.add(text);
this.addTextListener(this); // 有没有这个方法阿?监听文本区内容变化的应该是这个类吧,方法怎么写啊,这样写有错误
this.pack();
this.show();
} public void textValueChanged(TextEvent e)
{
System.out.println ("怎样写啊???");
}
public static void main(String s[])
{
new Demo();
}
}
this.addTextListener(new TextListener(){
public void textValueChanged(TextEvent e)
{
System.out.println ("怎样写啊???");
}
});
{
this.add(text);
this.addTextListener(this); // 这个方法应该是什么?我写这个不对啊
}
public void textValueChanged(TextEvent e)
{
System.out.println ("怎样写啊???");
}
});