第二节直播课

package com.imau.gui;
import javax.naming.InitialContext;
public class Login extends JFrame {
private JLabel lname;
private JLabel lpass;
private JTextField tname;
private JTextField tpass;
private JButton login;
private JCheckBox box1,box2;
//多选按钮
//Box1.isSelected();
private JRadioButton r1,r2;
//按钮组 单选只能选一个。
private ButtonGroup group;
//列表框
//private JList list;
//下拉框
//private JList comboBox;
private void inin() {

lname=new JLabel(“用户名”);
lpass=new JLabel("密 码 ");
tname=new JTextField(14);
tpass=new JTextField(14);
login=new JButton(“登录”);
box1=new JCheckBox(“记住密码”);
box2=new JCheckBox(“自动登录”);
r1=new JRadioButton(“在线”);
r2=new JRadioButton(“离线”);
//ComboBox.getSelectedItem();
//comboBOX.getSelectedIndex();
//判断是否选中
//ri.isSelected;
group=new ButtonGroup();
//放到按钮组中
//list=new JList(new String[] {“a”,“b”,“c”});
//设置可见几项 配合滚动面板使用
//list.setVisibleRowCount(1);
//this.add(list);
//comboBox = new JComboBox<>(new String[] {“a”,“b”,“c”});
//list();.getVisibleRowCount(3);
group.add(r1);
group.add(r2);

你可能感兴趣的:(第一单元)