阅读下列程序,请写出该程序的功能。import java.awt.*;import javax.swing.*;public class Cla
阅读下列程序,请写出该程序的功能。
import java.awt.*;
import javax.swing.*;
public class Class32
{public static void main(String[] args)
{
JFrame. frame=new JFrame("登录对话框");
TextField id=new TextField(12);
TextField pw=new TextField(12);
JButton login=new JButton("登录");
JButton cancel=new JButton("取消");
pw.setEchoChar('*');
frame.setLayout(new GridLayout(3,2));
frame.add(new JLabel("ID:",JLabel.RIGHT));
frame.add(id);
frame.add(new JLabel("密码:",JLabel.CENTER));
frame.add(pw);
frame.add(login);
frame.add(cancel);
frame.pack();
frame.setVisible(true);
}
}