当前位置:首页 > 大学生社团信息管理系统
当单击退出系统,该系统就会直接退出,相应的代码如下: private class ExitSystemAction implements ActionListener
{
}
}
public void actionPerformed(ActionEvent arg0) { System.exit(0);
5.2.2人员管理功能
(1)人员信息录入
单击人员信息录入,系统会跳出人员信息录入窗口,程序运行结果如图5.4所示:
图5.4 人员信息录入窗体运行结果
当用户单击录入按钮,则信息则会添加到数据库的nformation表中,当单击取消按钮,则文本框中的内容全部为空,可以重新输入。相应的代码如下:
人员信息录入代码: package com.zky.www.view;
public class Addpeople extends JInternalFrame {
private JLabel lbTip = new JLabel(\社团人员信息录入\private JLabel name = new JLabel(\姓名:\private JTextField inputName = new JTextField();
25
private JLabel sex = new JLabel(\性别:\private ButtonGroup group=new ButtonGroup(); private JRadioButton JRB1=new JRadioButton(\男\private JRadioButton JRB2=new JRadioButton(\女\private JLabel brithday=new JLabel(\出生日期:\private Choice choiceOne=new Choice(); private Choice choiceTwo=new Choice(); private Choice choiceThree=new Choice(); private JLabel address=new JLabel(\家庭住址:\private JTextField inputAdress=new JTextField(); private JLabel year=new JLabel(\年\private JLabel month=new JLabel(\月\private JLabel day=new JLabel(\日\private JLabel tel=new JLabel(\联系电话:\private JTextField inputTel=new JTextField(); private JLabel organization=new JLabel(\所在社团:\
private Choice choiceFour=new Choice();
private JLabel position=new JLabel(\担任职务:\private Choice choiceFive=new Choice(); private Button btnAdd=new Button(\录入\private Button btnCancel=new Button(\取消\Addpeople() {
JRB1.setActionCommand(\男\JRB2.setActionCommand(\女\this.setBounds(50, 90, 600, 450);; this.setTitle(\信息录入\this.setIconifiable(true); this.setClosable(true);
Container con=this.getContentPane(); con.setLayout(null);
26
lbTip.setBounds(0, 0, 600, 50); con.add(lbTip);
name.setBounds(80, 80, 50, 25); con.add(name);
inputName.setBounds(160, 80, 150, 23); con.add(inputName); sex.setBounds(80, 115, 50, 25); JRB1.setBounds(160, 115, 50, 25); JRB2.setBounds(260,115, 50, 25); con.add(sex); con.add(JRB1); con.add(JRB2);
brithday.setBounds(80, 150, 90, 25); choiceOne.setBounds(180, 150, 70, 25); year.setBounds(260, 150, 40, 25); choiceTwo.setBounds(290, 150, 70, 25); month.setBounds(370, 150, 40, 25); choiceThree.setBounds(400, 150, 70, 25); day.setBounds(500, 150, 30, 25); con.add(brithday); con.add(choiceOne); con.add(choiceTwo); con.add(choiceThree); con.add(year); con.add(month); con.add(day);
for(int i=1990;i<=2017;i++)
choiceOne.add(String.valueOf(i));
27
for(int j=1;j<=12;j++)
choiceTwo.add(String.valueOf(j));
for(int k=1;k<=31;k++)
choiceThree.add(String.valueOf(k));
group.add(JRB1); group.add(JRB2);
address.setBounds(80, 190, 80, 25); inputAdress.setBounds(180, 190, 150, 23); con.add(address); con.add(inputAdress); tel.setBounds(80, 230, 80, 25); inputTel.setBounds(180, 230, 150, 23); con.add(tel); con.add(inputTel);
organization.setBounds(80, 270, 80, 25); position.setBounds(80, 310, 80, 25); choiceFour.setBounds(180, 270, 150, 30); choiceFive.setBounds(180, 310, 150, 30); con.add(choiceFour); con.add(choiceFive); con.add(organization); con.add(position);
choiceFour.add(\青年志愿者协会\choiceFour.add(\篮球协会\choiceFour.add(\英语协会\choiceFour.add(\校学生会\choiceFive.add(\会长\choiceFive.add(\副会长\choiceFive.add(\社团成员\btnAdd.setBounds(150, 355, 60, 30); btnCancel.setBounds(270, 355, 60, 30);
28
共分享92篇相关文档