明天交项目要答辩了,哪位高手能帮我注释一下这段代码?谢谢。
button1 = new JButton("申请号码"); cstObj.anchor = GridBagConstraints.NORTHWEST;
cstObj.gridx = 3;
cstObj.gridy = 1;
cstObj.gridwidth = 1;
cstObj.fill = GridBagConstraints.BOTH;
layoutObj.setConstraints(button1,cstObj);
panelObj.add(button1);
labelPW = new JLabel("QQ密码");
cstObj.anchor = GridBagConstraints.CENTER;
cstObj.gridx = 0;
cstObj.gridy = 2;
cstObj.fill = GridBagConstraints.BOTH;
layoutObj.setConstraints(labelPW,cstObj);
panelObj.add(labelPW);
textPW = new JTextField(15);
cstObj.anchor = GridBagConstraints.NORTHWEST;
cstObj.gridx = 1;
cstObj.gridy = 2;
cstObj.gridwidth = 2;
cstObj.fill = GridBagConstraints.BOTH;
layoutObj.setConstraints(textPW,cstObj);
panelObj.add(textPW);
checkAuto = new JCheckBox();
labelAuto = new JLabel("自动登录");
cstObj.anchor = GridBagConstraints.NORTHWEST;
cstObj.gridx = 1;
cstObj.gridy = 3;
cstObj.gridwidth = 1;
cstObj.fill = GridBagConstraints.BOTH;
layoutObj.setConstraints(checkAuto,cstObj);
layoutObj.setConstraints(labelAuto,cstObj);
panelObj.add(checkAuto);
panelObj.add(labelAuto);
checkHide = new JCheckBox();
labelHide = new JLabel("隐身登录");
cstObj.anchor = GridBagConstraints.NORTHWEST;
cstObj.gridx = 2;
cstObj.gridy = 3;
cstObj.gridwidth = 1;
cstObj.fill = GridBagConstraints.BOTH;
layoutObj.setConstraints(checkHide,cstObj);
layoutObj.setConstraints(labelHide,cstObj);
panelObj.add(checkHide);
panelObj.add(labelHide);
button2 = new JButton("高级设置");
cstObj.anchor = GridBagConstraints.NORTHWEST;
cstObj.gridx = 0;
cstObj.gridy = 4;
cstObj.gridwidth = 1;
cstObj.fill = GridBagConstraints.BOTH;
layoutObj.setConstraints(button2,cstObj);
panelObj.add(button2);
button3 = new JButton("登录");
cstObj.anchor = GridBagConstraints.NORTHWEST;
cstObj.gridx = 2;
cstObj.gridy = 4;
cstObj.gridwidth = 1;
cstObj.fill = GridBagConstraints.BOTH;
layoutObj.setConstraints(button3,cstObj);
panelObj.add(button3);
button4 = new JButton("取消");
cstObj.gridwidth = 1;
cstObj.anchor = GridBagConstraints.NORTHWEST;
cstObj.gridx = 3;
cstObj.gridy = 4;
cstObj.gridwidth = 1;
cstObj.fill = GridBagConstraints.BOTH;
layoutObj.setConstraints(button4,cstObj);
panelObj.add(button4);
}
public static void main(String args[])
{
frameObj = new JFrame("QQ用户登录");
QQLogin f1 = new QQLogin();
frameObj.setSize(330,238);
frameObj.setVisible(true);
}
}