import java.awt.*;
import java.awt.event.*;
class WindowText extends Frame
{
TextField text1,text2;
WindowText(String s)
{
super (s);
setLayout(new FlowLayout());
text1=new TextField("输入密码",10);
text1.setEditable(false);
text2=new TextField(10);
text2.setEchoChar('*');
add(text1);
add(text2);
setBounds(0,0,400,400);
setVisible(true);
validate();
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
}
class Example4_7
{
public static void main(String[] args)
{
WindowText a=new WindowText("完善");
}
}
实现了一些文本框的功能的窗口
最新推荐文章于 2021-08-15 18:06:36 发布