Java 大作业之学生信息管理系统—The Five

还有

点击学生基本信息管理即可进入管理窗口 由studentinfo.java实现

如图

Java 大作业之学生信息管理系统—The Five
Java 大作业之学生信息管理系统—The Five
Java 大作业之学生信息管理系统—The Five
Java 大作业之学生信息管理系统—The Five

实现代码 如下:

[cce]
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Vector;
import java.sql.*;
///这是学生类信息系统的框架类
/// studentinfoframe是顶层窗口框架。
///通过八个文本域控件来分别可以显示不同班级、不同系的学生信息。
///三个按钮控件分别产生三个不同的动作事件简史事件,分别是添加,删除和更新。Addition是添加。Delete是删除,update是更新
///在布局方面有两个布局管理器,一个是lay即网格组布局。一个是jp是GridLayout布局。
///通过不同的SQL语句进入不同的班级和系的管理系统。
///使用将数据库中的数据先导入到vec中。然后在将vec中的数据导入学生类中。最后再将数据输出
class studentinfo extends JPanel
{
private static final long serialVersionUID = 1L;
static final int WIDTH=700;
static final int HEIGHT=400;

final JTextField stnameinput;
final JTextField stusernameinput;
final JTextField stsexinput;
final JTextField stzhuanyeinput;
final JTextField stsushenumberinput;
final JTextField stsushephoneinput;
final JTextField stqqinput;
final JTextField stemailinput;

final     JLabel name;
final     JLabel code;
final     JLabel sexy;
final     JLabel birthday;
final     JLabel address;
final      JLabel age;
final     JLabel grade;
final     JLabel major;
final     JLabel title;

final   JButton addition;
final   JButton delete;
final   JButton update;
final   JButton bereturn;
final   JButton qxingming;
final   JButton qxuehao;

static JFrame studentinfoframe;

//storesystem store=new storesystem();

// Connection con=store.getConnection();

//addframe af=new addframe();
//af.setVisible(false);

public void add(Component c,GridBagConstraints constraints,int x,int y,int w,int h)
{
constraints.gridx=x;
constraints.gridy=y;
constraints.gridwidth=w;
constraints.gridheight=h;
add(c,constraints);
}

private static studentinfo instance;

public static studentinfo getInstance(String str,String sql)
{
if ( instance == null )
{
instance = new studentinfo(str,sql);
return instance;
}
else
{    studentinfoframe.setVisible(true);
return instance;}
}
private studentinfo(String str,String sql)
{
studentinfoframe=new JFrame();
studentinfoframe.setTitle(str);
// studentinfoframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
studentinfoframe.setSize(WIDTH,HEIGHT);
Toolkit kit=Toolkit.getDefaultToolkit();
Dimension screenSize=kit.getScreenSize();
int width=screenSize.width;
int height=screenSize.height;
int x=(width-WIDTH)/2;
int y=(height-HEIGHT)/2;
studentinfoframe.setLocation(x,y);
studentinfoframe.setVisible(true);
studentinfoframe.setResizable(false);
studentinfoframe.add(this,BorderLayout.CENTER);
GridBagLayout lay=new GridBagLayout();
setLayout(lay);
name=new JLabel("姓名");
code=new JLabel("学号");
sexy=new JLabel("性别");
birthday=new JLabel("宿舍号码");
address=new JLabel("宿舍电话");
age=new JLabel("专业");
grade=new JLabel("qq号码");
major=new JLabel("电子邮箱");
title=new JLabel(str);

stnameinput=new JTextField(10);

stusernameinput=new JTextField(10);
//stusernameinput.setEditable(false);

stsexinput=new JTextField(10);

stzhuanyeinput=new JTextField(10);

stsushenumberinput=new JTextField(10);

stsushephoneinput=new JTextField(10);

stqqinput=new JTextField(10);

stemailinput=new JTextField(10);

addition=new JButton("添加");
delete=new JButton("删除");
update=new JButton("修改");
bereturn=new JButton("查询");

qxingming=new JButton("按姓名查询");
qxuehao=new JButton("按学号查询");

sexy.setVisible(false);//隐藏jlabel
birthday.setVisible(false);
address.setVisible(false);
age.setVisible(false);
grade.setVisible(false);
major.setVisible(false);

stsexinput.setVisible(false);//隐藏jtextfield

stzhuanyeinput.setVisible(false);

stsushenumberinput.setVisible(false);

stsushephoneinput.setVisible(false);

stqqinput.setVisible(false);

stemailinput.setVisible(false);

addition.setVisible(false);////隐藏jbutton
delete.setVisible(false);
update.setVisible(false);
bereturn.setVisible(false);

GridBagConstraints constraints=new GridBagConstraints();
constraints.fill=GridBagConstraints.NONE;
constraints.weightx=4;
constraints.weighty=6;

//使用网格组布局添加控件

add(title,constraints,0,0,4,1); //第0列第0行

add(name,constraints,0,1,1,1); //第0列第1行
add(code,constraints,0,2,1,1); //第0列第2行
add(sexy,constraints,0,3,1,1); //第0列第3行
add(age,constraints,0,4,1,1);   //第0列第4行

add(stnameinput,constraints,1,1,1,1);
add(stusernameinput,constraints,1,2,1,1);
add(stsexinput,constraints,1,3,1,1);
add(stzhuanyeinput,constraints,1,4,1,1);

add(birthday,constraints,2,1,1,1);
add(address,constraints,2,2,1,1);
add(grade,constraints,2,3,1,1);
add(major,constraints,2,4,1,1);

add(qxingming,constraints,2,1,1,1);
add(qxuehao,constraints,2,2,1,1);

add(stsushenumberinput,constraints,3,1,1,1);
add(stsushephoneinput,constraints,3,2,1,1);
add(stqqinput,constraints,3,3,1,1);
add(stemailinput,constraints,3,4,1,1);

add(bereturn,constraints,0,5,1,1);
add(update,constraints,1,5,1,1);
add(delete,constraints,2,5,1,1);
add(addition,constraints,3,5,1,1);

qxingming.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent Event)
{
String sql ="select * from info where name='"+stnameinput.getText()+"'";
try
{ DBconnection con= new DBconnection();
Statement st=con.getConnection();

ResultSet rs=st.executeQuery(sql);
if(rs.next())

{

stusernameinput.setText(rs.getString(2));
stnameinput.setText(rs.getString(3));
stsexinput.setText(rs.getString(4));

stzhuanyeinput.setText(rs.getString(5));

stsushenumberinput.setText(rs.getString(6));

stsushephoneinput.setText(rs.getString(7));

stqqinput.setText(rs.getString(8));

stemailinput.setText(rs.getString(9));

stusernameinput.setEditable(false);

sexy.setVisible(true);
birthday.setVisible(true);
address.setVisible(true);
age.setVisible(true);
grade.setVisible(true);
major.setVisible(true);

stsexinput.setVisible(true);

stzhuanyeinput.setVisible(true);

stsushenumberinput.setVisible(true);

stsushephoneinput.setVisible(true);

stqqinput.setVisible(true);

stemailinput.setVisible(true);

addition.setVisible(true);
delete.setVisible(true);
update.setVisible(true);
bereturn.setVisible(true);

qxingming.setVisible(false);
qxuehao.setVisible(false);

rs.close();
st.close();

}
else //错误提示

{
JOptionPane.showMessageDialog(null,"你输入的姓名不存在!", "友情提示",JOptionPane.INFORMATION_MESSAGE);
stusernameinput.setText("");
stnameinput.setText("");
}
}
catch(SQLException e) {JOptionPane.showMessageDialog(null,e.getMessage(), "对不起,出错啦",JOptionPane.ERROR_MESSAGE); stusernameinput.setText("");
stnameinput.setText("");}

}
});

qxuehao.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent Event)
{
String sql ="select * from info where username='"+stusernameinput.getText()+"'";
try
{ DBconnection con= new DBconnection();
Statement st=con.getConnection();

ResultSet rs=st.executeQuery(sql);
if(rs.next())

{

stusernameinput.setText(rs.getString(2));
stnameinput.setText(rs.getString(3));
stsexinput.setText(rs.getString(4));

stzhuanyeinput.setText(rs.getString(5));

stsushenumberinput.setText(rs.getString(6));

stsushephoneinput.setText(rs.getString(7));

stqqinput.setText(rs.getString(8));

stemailinput.setText(rs.getString(9));

stusernameinput.setEditable(false);
sexy.setVisible(true);
birthday.setVisible(true);
address.setVisible(true);
age.setVisible(true);
grade.setVisible(true);
major.setVisible(true);

stsexinput.setVisible(true);

stzhuanyeinput.setVisible(true);

stsushenumberinput.setVisible(true);

stsushephoneinput.setVisible(true);

stqqinput.setVisible(true);

stemailinput.setVisible(true);

addition.setVisible(true);
delete.setVisible(true);
update.setVisible(true);
bereturn.setVisible(true);

qxingming.setVisible(false);
qxuehao.setVisible(false);

rs.close();
st.close();
}
else //错误提示

{
JOptionPane.showMessageDialog(null,"你输入的学号不存在!", "友情提示",JOptionPane.INFORMATION_MESSAGE);
stusernameinput.setText("");
stnameinput.setText("");
}
}
catch(SQLException e) {JOptionPane.showMessageDialog(null,e.getMessage(), "对不起,出错啦",JOptionPane.ERROR_MESSAGE); stusernameinput.setText("");
stnameinput.setText("");}
}
});

///查询主菜单
bereturn.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent Event)
{

qxingming.setVisible(true);
qxuehao.setVisible(true);

stusernameinput.setEditable(true);
stusernameinput.setText("");
stnameinput.setText("");

sexy.setVisible(false);//隐藏jlabel
birthday.setVisible(false);
address.setVisible(false);
age.setVisible(false);
grade.setVisible(false);
major.setVisible(false);

stsexinput.setVisible(false);//隐藏jtextfield

stzhuanyeinput.setVisible(false);

stsushenumberinput.setVisible(false);

stsushephoneinput.setVisible(false);

stqqinput.setVisible(false);

stemailinput.setVisible(false);

addition.setVisible(false);////隐藏jbutton
delete.setVisible(false);
update.setVisible(false);
bereturn.setVisible(false);

}
});
///进入添加主界面
addition.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent Event)
{
addframe    addfr=addframe.getInstance();
//addframe addfr=new addframe();
// addfr.setVisible(true);
}
});
///修改按钮,使得从数据库表中,将数据提取显示到界面中
update.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent Event)
{

String sql ="update info set name='"+stnameinput.getText()+"',sex='"+stsexinput.getText()+"',zhuanye='"+stzhuanyeinput.getText()+"',sushenumber='"+stsushenumberinput.getText()+"',sushephone='"+stsushephoneinput.getText()+"',qq='"+stqqinput.getText()+"',email='"+stemailinput.getText()+"'"+"where username='"+stusernameinput.getText()+"'";
try

{
DBconnection con= new DBconnection();

Statement st=con.getConnection();

if(st.executeUpdate(sql)!=0)
{
JOptionPane.showMessageDialog(null,"修改记录成功", "友情提示",JOptionPane.INFORMATION_MESSAGE);
}
st.close();

}
catch(SQLException e) {JOptionPane.showMessageDialog(null,e.getMessage(), "对不起,出错啦",JOptionPane.ERROR_MESSAGE);}

String qsql ="select * from info where username='"+stusernameinput.getText()+"'";
try
{ DBconnection con= new DBconnection();
Statement st=con.getConnection();

ResultSet rs=st.executeQuery(qsql);
if(rs.next())

{

stusernameinput.setText(rs.getString(2));
stnameinput.setText(rs.getString(3));
stsexinput.setText(rs.getString(4));

stzhuanyeinput.setText(rs.getString(5));

stsushenumberinput.setText(rs.getString(6));

stsushephoneinput.setText(rs.getString(7));

stqqinput.setText(rs.getString(8));

stemailinput.setText(rs.getString(9));

rs.close();
st.close();
}
else //错误提示

{
JOptionPane.showMessageDialog(null,"读取数据出错啦", "友情提示",JOptionPane.INFORMATION_MESSAGE);

}
}
catch(SQLException e) {JOptionPane.showMessageDialog(null,e.getMessage(), "对不起,出错啦",JOptionPane.ERROR_MESSAGE);}

}
});
///删除数据,且更新到数据库中
delete.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent Event)
{

String sql ="delete * from info where username='"+stusernameinput.getText()+"'";
try

{
DBconnection con= new DBconnection();

Statement st=con.getConnection();

//ResultSet rs=st.executeQuery(sql);

if(st.executeUpdate(sql)!=0)
{ JOptionPane.showMessageDialog(null,"删除记录成功", "友情提示",JOptionPane.INFORMATION_MESSAGE);
}
st.close();
}
catch(SQLException e) {JOptionPane.showMessageDialog(null,e.getMessage(), "对不起,出错啦",JOptionPane.ERROR_MESSAGE);}

stusernameinput.setText("");
stnameinput.setText("");
stsexinput.setText("");

stzhuanyeinput.setText("");

stsushenumberinput.setText("");

stsushephoneinput.setText("");

stqqinput.setText("");

stemailinput.setText("");

}
});

}
}
[/cce]

Java 大作业之学生信息管理系统—The Four

继续

点击学生信息系统即可进入此窗体。由studentmanageframe.java实现 如图

Java 大作业之学生信息管理系统—The Four
Java 大作业之学生信息管理系统—The Four

实现的代码如下:

[cce]
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.util.Vector;
import javax.swing.*;
///这是一个学生信息系统的入口框架类。
///studentframe是顶层窗口框架。
///通过七个按钮控件来分别可以进入到不同班级、不同系的学生信息系统中。
///七个按钮控件分别产生七个不同的动作事件简史事件,分别进入不同的信息系统。
///在布局方面有两个布局管理器,一个是lay即网格组布局。一个是jp是GridLayout布局。
///通过不同的SQL语句进入不同的班级和系的管理系统。
class studentmanageframe extends JPanel
{
private static final long serialVersionUID = 1L;
static final int WIDTH=290;
static final int HEIGHT=250;
static JFrame studentframe;

private static studentmanageframe instance;

public static studentmanageframe getInstance()
{
if ( instance == null )
{
instance = new studentmanageframe();
return instance;
}
else
{    studentframe.setVisible(true);
return instance;

}
}

private studentmanageframe()
{
studentframe=new JFrame();
studentframe.setTitle("学生信息管理系统");
studentframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
studentframe.setSize(WIDTH,HEIGHT);
Toolkit kit=Toolkit.getDefaultToolkit();
Dimension screenSize=kit.getScreenSize();
int width=screenSize.width;
int height=screenSize.height;
int x=(width-WIDTH)/2;
int y=(height-HEIGHT)/2;
studentframe.setLocation(x,y);
studentframe.setVisible(true);
studentframe.setResizable(false);

studentframe.add(this, BorderLayout.CENTER);

JButton computerone=new JButton("学生基本信息管理");
JButton computertwo=new JButton("学生课程管理");
JButton computerthree=new JButton("学生成绩管理");
JButton bioone=new JButton("返回");

computerone.setSize(140,50);
computerone.setLocation(80,0);

computertwo.setSize(140,50);
computertwo.setLocation(80,50);

computerthree.setSize(140,50);
computerthree.setLocation(80,100);

bioone.setSize(140,50);
bioone.setLocation(80,150);
//JButton mechone=new JButton("5");
//JButton mechtwo=new JButton("6");
//JButton mechthree=new JButton("7");
JLabel title=new JLabel("学生信息系统主界面");
JLabel banket1=new JLabel();
JLabel banket2=new JLabel();
//GridBagLayout lay=new GridBagLayout();
studentframe.setLayout(null);
// GridBagConstraints constraints=new GridBagConstraints();
// constraints.fill=GridBagConstraints.NONE;
//constraints.anchor=GridBagConstraints.EAST;
//constraints.weightx=2;
//constraints.weighty=5;
JPanel jp=new JPanel();
//jp.setLayout(new GridLayout(1,3));
jp.add(banket1);
jp.add(title);
jp.add(banket2);
studentframe.add(jp,BorderLayout.NORTH);
studentframe.add(computerone); //,constraints,1,1,1,1                //使用网格组布局添加控件
studentframe.add(computertwo);//,constraints,1,2,1,1
studentframe.add(computerthree);//,constraints,1,3,1,1
studentframe.add(bioone);//,constraints,1,4,1,1
//add(mechone,constraints,1,1,1,1);
//add(mechtwo,constraints,1,2,1,1);
// add(mechthree,constraints,1,3,1,1);
///单击这个按钮,进入到学生基本信息管理
computerone.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent Event)
{
studentinfo    student=studentinfo.getInstance("学生基本信息管理","select * from info ");

}
});
///单击这个按钮,进入到学生课程管理
computertwo.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent Event)
{
studentcou addfr=studentcou.getInstance("学生课程信息管理","select * from course ");

}
});
///单击这个按钮,进入到学生成绩管理
computerthree.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent Event)
{
studentmark addfr=studentmark.getInstance("学生成绩信息管理","select * from mark ");

}
});
///单击这个按钮,隐藏窗体
bioone.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent Event)
{
studentframe.setVisible(false);
}
});

}
public void add(Component c,GridBagConstraints constraints,int x,int y,int w,int h)
{
constraints.gridx=x;
constraints.gridy=y;
constraints.gridwidth=w;
constraints.gridheight=h;
add(c,constraints);
}
//public static void main(String[] args){
// studentmanageframe log=new studentmanageframe();}
}
[/cce]

Java 大作业之学生信息管理系统—The Three

接着上面继续讲

学生信息管理主界面模块是由maniframe.java主窗口类实例化,进入其他的窗体。验证登陆后就可进入此窗体。

Java 大作业之学生信息管理系统—The Three
Java 大作业之学生信息管理系统—The Three

实现的代码如下:

[cce]
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
///这是一个主界面的类。
///student是指进入学生信息系统的界面控件
///teacher是指进入教师信息系统的界面控件
///leader是指进入领导信息系统的界面控件
///后面紧接着就是这个三个控件的动作事件的监视方法,分别是进入三个不同的系统
class mainframe
{
static final int WIDTH=290;
static final int HEIGHT=250;
JFrame buttonframe;
private JMenuBar mb ;//声明工具栏
private JMenu query,alter,delete,abouthelp,insert;//声明菜单
private JMenuItem q1,q2,q3,q4,q5,q6,a1,a2,a3,a4,a5,a6,d1,d2,d3,info,about,i1,i2,i3,i4;//菜单选项
public mainframe()
{
buttonframe=new JFrame();
buttonframe.setTitle("信息管理系统");
buttonframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//
buttonframe.setSize(WIDTH,HEIGHT);
Toolkit kit=Toolkit.getDefaultToolkit();
Dimension screenSize=kit.getScreenSize();
int width=screenSize.width;
int height=screenSize.height;
int x=(width-WIDTH)/2;
int y=(height-HEIGHT)/2;
buttonframe.setLocation(x,y);
buttonframe.setVisible(true);
buttonframe.setResizable(false);
JMenuBar jMenuBar1 = new JMenuBar();
mb= new JMenuBar();//声明菜单栏

query= new JMenu("窗口");//声明菜单

insert=new JMenu("添加");
abouthelp=new JMenu("帮助");

q1=new JMenuItem("学生基本信息");//菜单项
q2=new JMenuItem("学生课程管理");
q3=new JMenuItem("学生成绩管理");
q4=new JMenuItem("教师信息管理");
q5=new JMenuItem("退出");

i1=new JMenuItem("学生基本信息");
i2=new JMenuItem("学生课程信息");
i3=new JMenuItem("学生成绩信息");
i4=new JMenuItem("教师信息管理");

info=new JMenuItem("系统说明");
about=new JMenuItem("关于作者");

mb.add(query);//添加菜单项

mb.add(insert);
mb.add(abouthelp);

query.add(q1);//添加下拉菜单
query.add(q2);
query.add(q3);
query.add(q4);
query.add(q5);

insert.add(i1);
insert.add(i2);
insert.add(i3);
insert.add(i4);

abouthelp.add(info);
abouthelp.add(about);

JButton student=new JButton("学生信息系统");
JButton teacher=new JButton("教师信息系统");
JButton leader=new JButton("管理员信息系统");
JButton cancel=new JButton("退出");
student.setSize(130,50);
student.setLocation(80,0);
teacher.setSize(130,50);
teacher.setLocation(80,50);
leader.setSize(130,50);
leader.setLocation(80,100);
cancel.setSize(130,50);
cancel.setLocation(80,150);
buttonframe.add(student);
buttonframe.add(teacher);
buttonframe.add(leader);
buttonframe.add(cancel);
buttonframe.setJMenuBar(mb);//设置菜单栏
buttonframe.setLayout(null);//new GridLayout(3,1)
student.addActionListener(new ActionListener() //点击学生按钮
{
public void actionPerformed(ActionEvent Event)
{
//进入学生管理页面
studentmanageframe    student=studentmanageframe.getInstance();
//studentmanageframe student= new studentmanageframe();
// String sql="select username,name,sex,zhuanye,sushenumber,sushephone,qq,email from info ";
// studentinfo info=new studentinfo("学生基本信息管理",sql);
}
});
teacher.addActionListener(new ActionListener() //点击教师按钮
{
public void actionPerformed(ActionEvent Event)
{
teacherinfo addfr=teacherinfo.getInstance("教师基本信息管理","select * from teacher ");
}
});
leader.addActionListener(new ActionListener() //点击管理员按钮
{
public void actionPerformed(ActionEvent Event)
{
JOptionPane.showMessageDialog(null,"该功能正在开发中!", "Sorry",JOptionPane.ERROR_MESSAGE);
}
});
cancel.addActionListener(new ActionListener() //点击退出按钮
{
public void actionPerformed(ActionEvent Event)
{

System.exit(0);
}
});
info.addActionListener(new ActionListener()//系统说明
{
public void actionPerformed(ActionEvent Event)
{

try
{

String fileName="readme.txt";
Runtime rt = Runtime.getRuntime();
String exePath ="C:\\WINDOWS\\system32\\notepad.exe "+".\\" +fileName;
rt.exec(exePath); }
catch(Exception e)
{JOptionPane.showMessageDialog(null,e.getMessage(), "对不起,出错啦",JOptionPane.ERROR_MESSAGE);}
}
});

q1.addActionListener(new ActionListener()//打开学生基本信息
{
public void actionPerformed(ActionEvent Event)
{
studentinfo    student=studentinfo.getInstance("学生基本信息管理","select * from info");

}
});

q2.addActionListener(new ActionListener()//打开学生基本信息
{
public void actionPerformed(ActionEvent Event)
{
studentcou addfr=studentcou.getInstance("学生课程信息管理","select * from course");
//    String sql="select * from course ";

//   studentcou cou=new studentcou("学生课程管理",sql);

}
});

q3.addActionListener(new ActionListener()//打开学生成绩信息
{
public void actionPerformed(ActionEvent Event)
{

studentmark addfr=studentmark.getInstance("学生成绩信息管理","select * from mark");
//addmarkframe addfr=addmarkframe.getInstance();
//    String sql="select * from course ";

//   studentcou cou=new studentcou("学生课程管理",sql);

}
});

q4.addActionListener(new ActionListener()//打开学生成绩信息
{
public void actionPerformed(ActionEvent Event)
{

teacherinfo addfr=teacherinfo.getInstance("教师基本信息管理","select * from teacher ");
}
});

q5.addActionListener(new ActionListener()//退出系统
{
public void actionPerformed(ActionEvent Event)
{
System.exit(0);
}
});
i1.addActionListener(new ActionListener()//打开添加学生基本信息窗口
{
public void actionPerformed(ActionEvent Event)
{
addframe addfr=addframe.getInstance();

}
});

i2.addActionListener(new ActionListener()//打开添加学生课程管理窗口
{
public void actionPerformed(ActionEvent Event)
{
addcourseframe addcourse=addcourseframe.getInstance();

}
});

i3.addActionListener(new ActionListener()//打开添加学生成绩管理窗口
{
public void actionPerformed(ActionEvent Event)
{
addmarkframe addmark=addmarkframe.getInstance();
}
});

i4.addActionListener(new ActionListener()//打开添加教师信息管理窗口
{
public void actionPerformed(ActionEvent Event)
{
addteacherframe addtea=addteacherframe.getInstance();
}
});

about.addActionListener(new ActionListener()//打开添加作者博客
{
public void actionPerformed(ActionEvent Event)
{

try
{

String url="http://hi.baidu.com/caijiamx";
Runtime.getRuntime().exec("rundll32   url.dll,FileProtocolHandler   "   +   url);
// Runtime rt = Runtime.getRuntime();
// String exePath ="C:\\WINDOWS\\system32\\notepad.exe "+".\\" +fileName;
// rt.exec(exePath); }
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e.getMessage(), "对不起,出错啦",JOptionPane.ERROR_MESSAGE);}

}
});

}
//public static void main(String[] args){
//mainframe log=new mainframe();}

}
[/cce]