资源简介
数据库课程设计:大学生社团管理系统。
包含的主要功能有:添加社团成员,修改成员信息,活动记录,等等
代码片段和文件信息
package mypackage;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Statement;
import javax.swing.*;
public class Add
{
public Add( String name )
{
Jframe frame = new Jframe(“添加界面“);
JPanel panel = new JPanel();
panel.setLayout(null);
JLabel lb1 = new JLabel(“您当前管理的社团为:“JLabel.RIGHT);
JLabel lb2 = new JLabel(nameJLabel.LEFT);
JLabel lb3 = new JLabel(“输入以下信息进行添加“);
lb2.setForeground(Color.blue);
JLabel tittle[] = new JLabel[6];
tittle[1] = new JLabel(“学号“);
tittle[2] = new JLabel(“社团号“);
tittle[3] = new JLabel(“姓名“);
tittle[4] = new JLabel(“职位“);
lb1.setBounds(100 45 180 40);
lb2.setBounds(290 45 100 40);
lb3.setBounds(1507520040);
lb1.setFont( new Font(“楷体“Font.BOLD17) );
lb2.setFont( new Font(“楷体“Font.BOLD17) );
lb3.setFont( new Font(“楷体“Font.BOLD17) );
panel.add(lb1);
panel.add(lb2);
panel.add(lb3);
int first = 100;
for( int i = 1 ; i <= 4 ; i++ ) //输入提示 /*姓名 学号 社团号 */
{
tittle[i].setBounds(first1208020);
panel.add(tittle[i]);
first = first+90;
}
JTextField input[] = new JTextField[6]; //添加输入框
for( int i = 1 ; i <= 4 ; i++ )
input[i] = new JTextField(80);
first = 75;
for( int i = 1 ; i <= 4 ; i++ )
{
input[i].setBounds(first1508520);
first = first+90;
panel.add(input[i]);
}
JButton confirmcancel; //返回 和确定按钮
confirm = new JButton(“确定“);
cancel = new JButton(“返回“);
confirm.setBounds(10025010030);
cancel.setBounds(30025010030);
panel.add(confirm);
panel.add(cancel);
frame.add(panel);
frame.setSize(500 500);
frame.setVisible(true);
frame.setLocationRelativeTo(null);
confirm.addActionListener( new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
boolean flag = true;
for( int i = 1 ; i <= 3 ; i++ )
{
if( input[i].getText().length() == 0 )
flag = false;
}
if( flag == false )
{
new Tip(“前三个空不能为空!“);
}
else
{
Statement st = new Connect().st;
try
{
st.executeUpdate(“insert into member values(“+input[1].getText()+““+input[2].getText()+““+“‘“+input[3].getText()+“‘“+““+“‘“+input[4].getText()+“‘“+“)“ );
new Tip(“添加成功“);
}
catch( Exception ee )
{
new Tip(“添加失败!“);
ee.printStackTrace();
}
}
}
});
cancel.addActionListener( new ActionListener() {
public void actionPerformed(ActionEvent e)
{
frame.setVisible(false);
frame.dispose();
}
});
}
public static void main( String args[] )
{
new Add(“123“);
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-10-31 18:02 Curriculum Design1\
文件 438 2018-06-25 20:41 Curriculum Design1\.classpath
文件 394 2018-06-25 20:20 Curriculum Design1\.project
目录 0 2018-06-25 20:20 Curriculum Design1\.settings\
文件 598 2018-06-25 20:20 Curriculum Design1\.settings\org.eclipse.jdt.core.prefs
目录 0 2018-10-30 20:09 Curriculum Design1\bin\
目录 0 2018-10-30 20:09 Curriculum Design1\bin\mypackage\
文件 1733 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Add$1.class
文件 806 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Add$2.class
文件 2748 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Add.class
文件 1838 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Connect.class
文件 650 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Delete$1.class
文件 650 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Delete$2.class
文件 650 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Delete$3.class
文件 1946 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Delete$4.class
文件 806 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Delete$5.class
文件 5695 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Delete.class
文件 1653 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Main$1.class
文件 2221 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Main$2.class
文件 675 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Main$3.class
文件 4326 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Main.class
文件 729 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Menu$1.class
文件 658 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Menu$2.class
文件 655 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Menu$3.class
文件 658 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Menu$4.class
文件 2335 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Menu.class
文件 711 2018-10-30 20:09 Curriculum Design1\bin\mypackage\Mypanel.class
文件 632 2018-10-30 20:09 Curriculum Design1\bin\mypackage\See$1.class
文件 632 2018-10-30 20:09 Curriculum Design1\bin\mypackage\See$2.class
文件 632 2018-10-30 20:09 Curriculum Design1\bin\mypackage\See$3.class
文件 790 2018-10-30 20:09 Curriculum Design1\bin\mypackage\See$4.class
............此处省略29个文件信息
- 上一篇:成绩管理业务流程图
- 下一篇:mgn-mqt82.zip
评论
共有 条评论