ActionListener
单选框选中 JRadioButton.isSelected()
退出界面 .dispose()
选中ComboBox 内容 getSelectedItem()
确认框 (有返回值)JOptionPane.showConfirmDialog(对象,信息,标题,格式)
package exper6;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class LoginFrm2 extends JFrame implements ActionListener{
public static void main(String[] args) {
new LoginFrm2();
}
JLabel lblname = new JLabel ("用户名:");
JLabel lblpwd = new JLabel ("密码 :");
JComboBox txtname = new JComboBox(new String[] {
"10000","10020"});
JPasswordField txtpwd = new JPasswordField(10);