一、源码特点
java swing社团管理系统 是一套完善的窗体设计系统,对理解SWING java 编程开发语言有帮助,系统具有完整的源代码和数据库,,系统主要采用C/S模式开发。
应用技术:java+mysql
开发工具:Myeclipse8.5、jdk。
二、功能介绍
社团管理系统要满足以下几个方面的功能需求:
(1)学校管理员管理:对学校管理员信息进行添加、删除、修改和查看
(2)社团管理:对社团信息进行添加、删除、修改和查看
(3)用户管理:对用户信息进行添加、删除、修改和查看
(4)新闻管理:对新闻信息进行添加、删除、修改和查看
(5)活动管理:对活动信息进行添加、删除、修改和查看
(6)参加活动管理:对参加活动信息进行添加、删除、修改和查看
(7)活动经费管理:对活动经费信息进行添加、删除、修改和查看
(8)密码修改、退出系统、登录
(9)个人信息修改
数据库设计
CREATE TABLE `xxgly` (
`xxglyid` int(11) NOT NULL auto_increment,
`yhm` VARCHAR(40) default NULL COMMENT '用户名',
`mm` VARCHAR(40) default NULL COMMENT '密码',
`xm` VARCHAR(40) default NULL COMMENT '姓名', PRIMARY KEY (`xxglyid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
CREATE TABLE `shetuan` (
`stid` int(11) NOT NULL auto_increment,
`stmc` VARCHAR(40) default NULL COMMENT '社团名称',
`js` VARCHAR(40) default NULL COMMENT '介绍', PRIMARY KEY (`stid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
CREATE TABLE `yonghu` (
`yhid` int(11) NOT NULL auto_increment,
`yhm` VARCHAR(40) default NULL COMMENT '用户名',
`mm` VARCHAR(40) default NULL COMMENT '密码',
`xm` VARCHAR(40) default NULL COMMENT '姓名',
`lxdh` VARCHAR(40) default NULL COMMENT '联系电话',
`st` VARCHAR(40) default NULL COMMENT '社团',
`qx` VARCHAR(40) default NULL COMMENT '权限', PRIMARY KEY (`yhid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
CREATE TABLE `xinwen` (
`xwid` int(11) NOT NULL auto_increment,
`bt` VARCHAR(40) default NULL COMMENT '标题',
`nr` VARCHAR(40) default NULL COMMENT '内容',
`fbsj` VARCHAR(40) default NULL COMMENT '发布时间',
`st` VARCHAR(40) default NULL COMMENT '社团',
`yh` VARCHAR(40) default NULL COMMENT '用户',
`zt` VARCHAR(40) default NULL COMMENT '状态', PRIMARY KEY (`xwid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
CREATE TABLE `huodong` (
`hdid` int(11) NOT NULL auto_increment,
`bt` VARCHAR(40) default NULL COMMENT '标题',
`js` VARCHAR(40) default NULL COMMENT '介绍',
`hdsj` VARCHAR(40) default NULL COMMENT '活动时间',
`st` VARCHAR(40) default NULL COMMENT '社团',
`yh` VARCHAR(40) default NULL COMMENT '用户',
`zt` VARCHAR(40) default NULL COMMENT '状态', PRIMARY KEY (`hdid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
代码设计
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jLabel1 = new javax.swing.JLabel();
jf = new javax.swing.JTextField();
hdjfid = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
js = new javax.swing.JTextArea();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
st = new javax.swing.JTextField();
yh = new javax.swing.JTextField();
zt = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
hdmc = new javax.swing.JTextField();
setBackground(new java.awt.Color(204, 204, 255));
setClosable(true);
setTitle("\u6211\u7684\u6d3b\u52a8\u7ecf\u8d39");
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object[][] { { null, null, null, null },
{ null, null, null, null }, { null, null, null, null },
{ null, null, null, null } }, new String[] { "Title 1",
"Title 2", "Title 3", "Title 4" }));
jScrollPane1.setViewportView(jTable1);
jLabel1.setText("\u6d3b\u52a8\u540d\u79f0");
jLabel2.setText("\u4ecb\u7ecd");
js.setColumns(20);
js.setRows(5);
jScrollPane2.setViewportView(js);
jLabel3.setText("\u7ecf\u8d39");
jLabel4.setText("\u793e\u56e2");
jLabel5.setText("\u7528\u6237");
jLabel6.setText("\u72b6\u6001");
st.setEditable(false);
yh.setEditable(false);
zt.setEditable(false);
jButton1.setText("\u4fdd\u5b58");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("\u8be6\u60c5");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setText("\u5173\u95ed");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jButton4.setText("\u5220\u9664");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE,
480,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addGap(37, 37,
37)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(
jLabel1)
.addComponent(
jLabel2)
.addComponent(
jLabel3)
.addComponent(
jLabel4)
.addComponent(
jLabel5)
.addComponent(
jLabel6))
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(
hdmc,
javax.swing.GroupLayout.DEFAULT_SIZE,
298,
Short.MAX_VALUE)
.addComponent(
hdjfid,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(
jf,
javax.swing.GroupLayout.DEFAULT_SIZE,
298,
Short.MAX_VALUE)
.addComponent(
jScrollPane2,
javax.swing.GroupLayout.DEFAULT_SIZE,
298,
Short.MAX_VALUE)
.addComponent(
st,
javax.swing.GroupLayout.DEFAULT_SIZE,
298,
Short.MAX_VALUE)
.addComponent(
yh,
javax.swing.GroupLayout.DEFAULT_SIZE,
298,
Short.MAX_VALUE)
.addComponent(
zt,
javax.swing.GroupLayout.DEFAULT_SIZE,
298,
Short.MAX_VALUE)))
.addGroup(
layout.createSequentialGroup()
.addGap(18, 18,
18)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(
jButton4)
.addGroup(
layout.createSequentialGroup()
.addComponent(
jButton1)
.addGap(18,
18,
18)
.addComponent(
jButton2)
.addGap(18,
18,
18)
.addComponent(
jButton3)))))
.addContainerGap()));
layout.setVerticalGroup(layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.DEFAULT_SIZE, 531,
Short.MAX_VALUE)
.addGroup(
layout.createSequentialGroup()
.addGap(25, 25, 25)
.addComponent(hdjfid,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(
hdmc,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addGap(22, 22,
22)
.addComponent(
jLabel2))
.addGroup(
layout.createSequentialGroup()
.addGap(18, 18,
18)
.addComponent(
jScrollPane2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(27, 27, 27)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(
jf,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addGap(28, 28, 28)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(
st,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(
yh,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(
jLabel6,
javax.swing.GroupLayout.PREFERRED_SIZE,
20,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(
zt,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2)
.addComponent(jButton3))
.addGap(18, 18, 18).addComponent(jButton4)
.addContainerGap(45, Short.MAX_VALUE)));
pack();
}// </editor-fold>
//GEN-END:initComponents
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
/***活动经费信息详情查看**/
int row = jTable1.getSelectedColumn();
if (row == -1) {// 判断是否选中
JOptionPane.showMessageDialog(null, "请选择要查看的数据!", "警告",
JOptionPane.WARNING_MESSAGE);
} else {
int n = 0;
System.out.println("n==" + n);
if (n == 0) {
String txthdjfid = jTable1.getValueAt(jTable1.getSelectedRow(),
0).toString();
String txthdmc = jTable1
.getValueAt(jTable1.getSelectedRow(), 1).toString();
String txtjs = jTable1.getValueAt(jTable1.getSelectedRow(), 2)
.toString();
String txtjf = jTable1.getValueAt(jTable1.getSelectedRow(), 3)
.toString();
String txtst = jTable1.getValueAt(jTable1.getSelectedRow(), 4)
.toString();
String txtyh = jTable1.getValueAt(jTable1.getSelectedRow(), 5)
.toString();
String txtzt = jTable1.getValueAt(jTable1.getSelectedRow(), 6)
.toString();
// System.out.println("rowNum==" + rowNum);
this.hdjfid.setText(txthdjfid);//活动经费编号信息赋值
this.hdmc.setText(txthdmc);//活动名称信息赋值
this.js.setText(txtjs);//介绍信息赋值
this.jf.setText(txtjf);//经费信息赋值
this.st.setText(txtst);//社团信息赋值
this.yh.setText(txtyh);//用户信息赋值
this.zt.setText(txtzt);//状态信息赋值
if (txtzt.equals("申请")) {
jButton4.setVisible(true);
}
}
}
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
/***活动经费信息删除方法**/
String txthdjfid = this.hdjfid.getText();// 删除编号
if (txthdjfid == null || txthdjfid.equals("")) {
JOptionPane.showMessageDialog(null, "请选择要删除的活动经费信息!", "警告",
JOptionPane.WARNING_MESSAGE);
return;
} else {
try {
DBO db = new DBO();//打开数据库链接
String sql = "delete from hdjf where hdjfid='" + txthdjfid
+ "'";//sql语句删除方法
db.update(sql);//执行sql语句
db.close();
} catch (Exception e) {
e.printStackTrace();
}
JOptionPane.showMessageDialog(null, "删除活动经费信息成功!", "警告",
JOptionPane.WARNING_MESSAGE);
this.Action();//删除完,刷新表格方法
}
}
三、注意事项
1、管理员账号:admin密码:admin 数据库配置文件DBO.java
2、开发环境为Myeclipse8.5开发,数据库为mysql,使用java语言开发。
3、数据库文件名是javashetuan.sql ,系统名称shetuan 启动类 login.java
四 系统实现
需要源码 其他的定制服务 下方联系卡片↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 或者私信作者
标签:java,addComponent,GroupLayout,Mysql,myeclipse,swing,new,javax,SIZE From: https://blog.csdn.net/qq_41221322/article/details/139371386