请哪位高手帮忙解决一下,我的Java applet经常显示不出来,代码编译通过,可是没有显示,怎么回事
importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.apple...
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.applet.*;
public class TextFieldExample extends Applet {
/**
*
*/
TextField password;
TextArea textArea;
//初始化
public void inist()
{
password=new TextField(12);//10 columns
password.setEchoChar('*');//*覆盖输入
add(password);
textArea=new TextArea(5,40);//添加文本域
textArea.append("this is some initial for text area");
textArea.select(5,12);
add(textArea);
password.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
textArea.setText("Your password is :"+event.getActionCommand());
}
});
}
} 展开
import java.awt.event.ActionListener;
import java.applet.*;
public class TextFieldExample extends Applet {
/**
*
*/
TextField password;
TextArea textArea;
//初始化
public void inist()
{
password=new TextField(12);//10 columns
password.setEchoChar('*');//*覆盖输入
add(password);
textArea=new TextArea(5,40);//添加文本域
textArea.append("this is some initial for text area");
textArea.select(5,12);
add(textArea);
password.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
textArea.setText("Your password is :"+event.getActionCommand());
}
});
}
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询