第十二周编程总结
1.实验代码
package test; import javax.swing.JLabel; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JTextField; import javax.swing.JPasswordField; public class ActionHandle{ JFrame frame=new JFrame("登录系统"); JButton submit=new JButton("登录"); JButton reset=new JButton("重置"); JLabel nameLab=new JLabel("用户名"); JLabel passLab=new JLabel("密码"); JTextField nameText=new JTextField(); JPasswordField passText=new JPasswordField(); public ActionHandle(){ frame.setLayout(null); nameLab.setBounds(5,5,60,20); passLab.setBounds(5,30,60,20); nameText.setBounds(65,5,100,20); passText.setBounds(65,30,100,20); submit.setBounds(45,70,60,20); reset.setBounds(110,70,60,20); frame.add(nameLab); frame.add(passLab); frame.add(nameText); frame.add(passText); frame.add(submit); frame.add(reset); frame.setSize(280,130); frame.setVisible(true); } }
package test; public class MyActionEventDemo02 { public static void main(String[] args){ new ActionHandle(); } }
2.实验结果
3.总结;
2.这次也差不多是通过看书完成的,比较简单。
3.