1、项目功能演示
DC00017基于java swing+MySQL教务管理系统GUI教务管理java swing项目
2、项目功能描述
基于java swing+MySQL教务管理系统分为学生、教师、系统管理员三个角色。
2.1 学生功能
1、系统登录、系统注册
2、成绩管理:成绩查看
3、课表管理:课表查看
4、选课管理:选择课程、已选课程
5、用户管理:个人基本信息查看、修改密码
2.2 教师功能
1、系统登录、系统注册
2、成绩管理:成绩查看及添加
3、课表管理:课表查看
4、选课管理:选课信息查看
5、用户管理:个人基本信息查看、修改密码
2.3 系统管理员功能
1、系统登录
2、学生管理:学生信息添加、删除、修改、查询
3、教师管理:教师信息添加、删除、修改、查询
4、课程管理:课程信息添加、删除、修改、查询
3、项目运行截图(部分)
4、项目核心代码(部分)
4.1 表单校验类
java
package com.qizu.stuinfo.util;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
public class FormCheck {
public static boolean isPhoneLegal(String str)throws PatternSyntaxException {
return isChinaPhoneLegal(str) || isHKPhoneLegal(str);
}
public static boolean isChinaPhoneLegal(String str) throws PatternSyntaxException {
String regExp = "^((13[0-9])|(15[^4])|(18[0,2,3,5-9])|(17[0-8])|(147))\\d{8}$";
Pattern p = Pattern.compile(regExp);
Matcher m = p.matcher(str);
return m.matches();
}
public static boolean isHKPhoneLegal(String str)throws PatternSyntaxException {
String regExp = "^(5|6|8|9)\\d{7}$";
Pattern p = Pattern.compile(regExp);
Matcher m = p.matcher(str);
return m.matches();
}
public static boolean isName(String str){
String regExp= "^(([\u4e00-\u9fa5]{2,8})|([a-zA-Z]{2,16}))$";
Pattern p=Pattern.compile(regExp);
Matcher m=p.matcher(str);
return m.matches();
}
public static boolean isSno(String str){
String regExp = "^[\\d]{13}$";
Pattern p = Pattern.compile(regExp);
Matcher m = p.matcher(str);
return m.matches();
}
public static boolean isTno(String str){
String regExp = "^[\\d]{7}$";
Pattern p = Pattern.compile(regExp);
Matcher m = p.matcher(str);
return m.matches();
}
public static boolean isMark(String str){
String regExp = "^[\\d]{1}$";
Pattern p = Pattern.compile(regExp);
Matcher m = p.matcher(str);
return m.matches();
}
public static boolean isCno(String str){
String regExp = "^[\\d]{5}$";
Pattern p = Pattern.compile(regExp);
Matcher m = p.matcher(str);
return m.matches();
}
public static boolean isBirth(String str){
String regExp="/^(19|20)\\d{2}-(1[0-2]|0?[1-9])-(0?[1-9]|[1-2][0-9]|3[0-1])$/";
Pattern p=Pattern.compile(regExp);
Matcher m=p.matcher(str);
return m.matches();
}
public static void main(String[] args){
System.out.println(isBirth("1995-7-28"));
}
}
4.2 数据库操作类
java
package com.qizu.stuinfo.util;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ResourceBundle;
public class JDBCUtil {
static final String DRIVERCLASS;
static final String URL;
static final String USERNAME;
static final String PASSWORD;
static{
ResourceBundle bundle=ResourceBundle.getBundle("jdbc");
DRIVERCLASS=bundle.getString("driverClass");
URL=bundle.getString("url");
USERNAME=bundle.getString("username");
PASSWORD=bundle.getString("password");
}
static{
try {
Class.forName(DRIVERCLASS);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
/**
* 获取数据库连接
* @return
* @throws SQLException
*/
public static Connection getConnection() throws SQLException{
return DriverManager.getConnection(URL,USERNAME,PASSWORD);
}
/**
* 关闭数据库资源
* @param conn
* @param statement
* @param resultSet
*/
public static void closeResource(Connection conn,Statement statement,ResultSet resultSet){
closeResultSet(resultSet);
closeStatement(statement);
closeConnection(conn);
}
public static void closeResultSet(ResultSet set){
if(set!=null){
try {
set.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
public static void closeStatement(Statement statement){
if(statement!=null){
try {
statement.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
public static void closeConnection(Connection connection){
if(connection!=null){
try {
connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
4.3 登录界面
java
package com.qizu.stuinfo.view;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.FontUIResource;
import com.alee.laf.WebLookAndFeel;
import com.qizu.stuinfo.bussiness.impl.AdminBussImpl;
import com.qizu.stuinfo.bussiness.impl.StudentBussImpl;
import com.qizu.stuinfo.bussiness.impl.TeacherBussImpl;
import com.qizu.stuinfo.bussiness.impl.UserStudentBussImpl;
import com.qizu.stuinfo.bussiness.impl.UserTeacherBussImpl;
import com.qizu.stuinfo.entity.Admin;
import com.qizu.stuinfo.entity.Student;
import com.qizu.stuinfo.entity.Teacher;
import com.qizu.stuinfo.entity.UserStudent;
import com.qizu.stuinfo.entity.UserTeacher;
import com.qizu.stuinfo.util.Location;
import com.qizu.stuinfo.util.MyFont;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import java.awt.Font;
import java.awt.Image;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import javax.imageio.ImageIO;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import java.awt.event.ActionListener;
import java.io.File;
import java.awt.event.ActionEvent;
import java.awt.Color;
public class LoginView extends JFrame {
private JPanel contentPane;
private JTextField jtf_user;
private JPasswordField jpf_psw;
private JComboBox jb_role;
public LoginView() {
//setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.setSize(800,500);
Location.setCenter(this);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel jlback=new JLabel(new ImageIcon("image/logo2.jpg"));
jlback.setBounds(0,0,800,500);
getLayeredPane().add(jlback,new Integer(Integer.MIN_VALUE));
((JPanel)getContentPane()).setOpaque(false);
JPanel jp_back = new JPanel();
jp_back.setBounds(226, 84, 325, 265);
contentPane.add(jp_back);
jp_back.setLayout(null);
jp_back.setOpaque(false);
JLabel jl_title = new JLabel("\u6559\u52A1\u7BA1\u7406\u7CFB\u7EDF");
jl_title.setFont(new Font("方正舒体", Font.BOLD, 32));
jl_title.setHorizontalAlignment(SwingConstants.CENTER);
jl_title.setBounds(77, 18, 249, 44);
jp_back.add(jl_title);
JLabel jl_role = new JLabel("\u89D2 \u8272\uFF1A");
jl_role.setBounds(27, 84, 67, 18);
jp_back.add(jl_role);
jl_role.setFont(MyFont.getMyFont());
JLabel jl_user = new JLabel("\u7528\u6237\u540D\uFF1A");
jl_user.setBounds(27, 128, 67, 18);
jp_back.add(jl_user);
jl_user.setFont(MyFont.getMyFont());
JLabel jl_psw = new JLabel("\u5BC6 \u7801\uFF1A");
jl_psw.setBounds(27, 181, 67, 18);
jl_psw.setFont(MyFont.getMyFont());
jp_back.add(jl_psw);
jtf_user = new JTextField();
jtf_user.setBounds(106, 122, 192, 30);
jp_back.add(jtf_user);
jtf_user.setColumns(10);
jtf_user.setFont(MyFont.getMyFont());
jb_role = new JComboBox();
jb_role.setModel(new DefaultComboBoxModel(new String[] {"\u7BA1\u7406\u5458", "\u6559\u5E08", "\u5B66\u751F"}));
jb_role.setBounds(106, 79, 192, 28);
jb_role.setFont(MyFont.getMyFont());
jp_back.add(jb_role);
jpf_psw = new JPasswordField();
jpf_psw.setBounds(106, 175, 192, 30);
jpf_psw.setFont(new Font("微软雅黑",Font.PLAIN,14));
jpf_psw.setEchoChar('●');
jp_back.add(jpf_psw);
JButton jb_login = new JButton("\u767B\u5F55");
jb_login.setBackground(Color.DARK_GRAY);
jb_login.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String user=jtf_user.getText().trim();
String psw=jpf_psw.getText().trim();
String select=(String) jb_role.getSelectedItem();
if("管理员".equals(select)){
Admin admin=new AdminBussImpl().getAdmin(new Admin(user,psw));
if(admin!=null){
LoginView.this.dispose();
new IndexView(admin);
}
else JOptionPane.showMessageDialog(LoginView.this, new JLabel("<html><font size=5>用户名或密码输入错误</font></html>"));
}else if("教师".equals(select)){
UserTeacher userTeacher=new UserTeacherBussImpl().getUserTeacher(new UserTeacher(user,psw));
if(userTeacher!=null){
LoginView.this.dispose();
String tno=userTeacher.getTno();
Teacher t=new Teacher();
t.setTno(tno);
new IndexView(new TeacherBussImpl().getTeacher(t));
}
else JOptionPane.showMessageDialog(LoginView.this, "<html><font size=5>用户名或密码输入错误</font></html>");
}else{
UserStudent userStudent=new UserStudentBussImpl().getUserStudent(new UserStudent(user,psw));
if(userStudent!=null){
LoginView.this.dispose();
String sno=userStudent.getSno();
Student t=new Student();
t.setSno(sno);
new IndexView(new StudentBussImpl().getStudent(t));
}
else JOptionPane.showMessageDialog(LoginView.this, "<html><font size=5>用户名或密码输入错误</font></html>");
}
}
});
jb_login.setBounds(106, 217, 90, 30);
jb_login.setFont(MyFont.getMyFont());
jp_back.add(jb_login);
JButton jb_register = new JButton("\u6CE8\u518C");
jb_register.setBounds(208, 217, 90, 30);
jb_register.setFont(MyFont.getMyFont());
jp_back.add(jb_register);
jb_register.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
LoginView.this.dispose();
new RegisterView();
}
});
}
}
4.4 系统主界面
java
package com.qizu.stuinfo.view;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Image;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.UIManager;
import javax.swing.plaf.FontUIResource;
import com.alee.laf.WebLookAndFeel;
import com.qizu.stuinfo.entity.Admin;
import com.qizu.stuinfo.entity.Student;
import com.qizu.stuinfo.entity.Teacher;
import com.qizu.stuinfo.entity.UserStudent;
import com.qizu.stuinfo.entity.UserTeacher;
import com.qizu.stuinfo.util.ImagePanel;
import com.qizu.stuinfo.util.Location;
import com.qizu.stuinfo.util.MyFont;
public class IndexView extends JFrame implements MouseListener{
JPanel centerPanel;
JPanel menuPanel;
JLabel jl_index;
JLabel jl_score;
JLabel jl_sechdule;
JLabel jl_course;
JLabel jl_user;
JLabel jl_student;
JLabel jl_teacher;
JLabel jl_admin_course;
JLabel jl_weclome;
int flag_index;
int flag_score;
int flag_sechdule;
int flag_course;
int flag_user;
int flag_student;
int flag_teacher;
int flag_admin_course;
Teacher teacher=null;
Student student=null;
Admin admin=null;
public IndexView(){
}
public IndexView(Admin admin){
this.setTitle("教务管理系统");
this.admin=admin;
this.setSize(1000,600);
this.setResizable(false);
Location.setCenter(this);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new BorderLayout());
UIManager.put("TabbedPane.tabAreaInsets", new javax.swing.plaf.InsetsUIResource(0, 0, 0, 0));
centerPanel=initCenterPanel();
menuPanel=initAdminMenuPanel();
jl_weclome.setText("欢迎 : "+admin.getAname());
jl_weclome.setFont(MyFont.getMyFont());
this.add(centerPanel,BorderLayout.CENTER);
this.add(menuPanel,BorderLayout.NORTH);
this.setVisible(true);
}
public IndexView(Student student ){
this.setTitle("教务管理系统");
this.student=student;
this.setSize(1000,600);
this.setResizable(false);
Location.setCenter(this);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new BorderLayout());
UIManager.put("TabbedPane.tabAreaInsets", new javax.swing.plaf.InsetsUIResource(0, 0, 0, 0));
centerPanel=initCenterPanel();
menuPanel=initMenuPanel();
jl_weclome.setText("欢迎 : "+student.getSname());
jl_weclome.setFont(MyFont.getMyFont());
this.add(centerPanel,BorderLayout.CENTER);
this.add(menuPanel,BorderLayout.NORTH);
this.setVisible(true);
}
public IndexView(Teacher teacher ){
this.setTitle("教务管理系统");
this.teacher=teacher;
this.setSize(1000,600);
this.setResizable(false);
Location.setCenter(this);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new BorderLayout());
UIManager.put("TabbedPane.tabAreaInsets", new javax.swing.plaf.InsetsUIResource(0, 0, 0, 0));
centerPanel=initCenterPanel();
menuPanel=initMenuPanel();
jl_weclome.setText("欢迎 : "+teacher.getTname());
jl_weclome.setFont(MyFont.getMyFont());
this.add(centerPanel,BorderLayout.CENTER);
this.add(menuPanel,BorderLayout.NORTH);
this.setVisible(true);
}
public JPanel initAdminMenuPanel(){
JPanel menuPanel=new JPanel();
JPanel toolPanel=new JPanel();
toolPanel.setPreferredSize(new Dimension(960,50));
menuPanel.setPreferredSize(new Dimension(850,50));
//toolPanel.add(menuPanel);
jl_weclome=new JLabel();
jl_weclome.setIcon(new ImageIcon("image/weclome.png"));
jl_weclome.setPreferredSize(new Dimension(110,50));
jl_weclome.setFont(MyFont.getMyFont());
toolPanel.add(menuPanel);
toolPanel.add(jl_weclome);
FlowLayout flowLayout=(FlowLayout)menuPanel.getLayout();
flowLayout.setAlignment(FlowLayout.LEFT);
jl_index=initMenu("首页");
jl_index.setIcon(new ImageIcon("image/index.png"));
jl_student=initMenu("学生管理");
jl_student.setIcon(new ImageIcon("image/student.png"));
jl_teacher=initMenu("教师管理");
jl_teacher.setIcon(new ImageIcon("image/teacher.png"));
jl_admin_course=initMenu("课程管理");
jl_admin_course.setIcon(new ImageIcon("image/course.png"));
menuPanel.add(jl_index);
menuPanel.add(jl_student);
menuPanel.add(jl_teacher);
menuPanel.add(jl_admin_course);
createIndex();
return toolPanel;
}
public JPanel initMenuPanel(){
JPanel menuPanel=new JPanel();
JPanel toolPanel=new JPanel();
toolPanel.setPreferredSize(new Dimension(960,50));
menuPanel.setPreferredSize(new Dimension(850,50));
toolPanel.add(menuPanel);
jl_weclome=new JLabel();
jl_weclome.setPreferredSize(new Dimension(110,50));
jl_weclome.setIcon(new ImageIcon("image/weclome.png"));
FlowLayout flowLayout=(FlowLayout)menuPanel.getLayout();
flowLayout.setAlignment(FlowLayout.LEFT);
jl_index=initMenu("首页");
jl_index.setIcon(new ImageIcon("image/index.png"));
jl_score=initMenu("成绩管理");
jl_score.setIcon(new ImageIcon("image/score.png"));
jl_sechdule=initMenu("课表管理");
jl_sechdule.setIcon(new ImageIcon("image/sechdule.png"));
jl_course=initMenu("选课管理");
jl_course.setIcon(new ImageIcon("image/course.png"));
jl_user=initMenu("用户管理");
jl_user.setIcon(new ImageIcon("image/user.png"));
menuPanel.add(jl_index);
menuPanel.add(jl_score);
menuPanel.add(jl_sechdule);
menuPanel.add(jl_course);
menuPanel.add(jl_user);
createIndex();
toolPanel.add(jl_weclome);
return toolPanel;
}
public JPanel initCenterPanel(){
JPanel panel=new JPanel();
panel.setLayout(new BorderLayout());
return panel;
}
public JLabel initMenu(String name){
JLabel menu=new JLabel();
menu.setFont(MyFont.getMyFont());
menu.setPreferredSize(new Dimension(94,40));
menu.setText("<html><font color='black' >"+name+" | "+"</font></html>");
menu.addMouseListener(this);
return menu;
}
public void createIndex(){
centerPanel.removeAll();
flag_index=1;
flag_score=0;
flag_sechdule=0;
flag_course=0;
flag_user=0;
flag_student=0;
flag_teacher=0;
flag_admin_course=0;
jl_index.setText("<html><font color='#336699' style='font-weight:bold'>" + "首页 | " + "</font> </html>");
jl_index.setPreferredSize(new Dimension(70,40));
ImagePanel backPanel=ViewFactory.getIndexBackPanel();
centerPanel.add(backPanel);
}
public void createAdminStudent(){
centerPanel.removeAll();
flag_index=0;
flag_student=1;
flag_teacher=0;
flag_user=0;
flag_admin_course=0;
JTabbedPane tab=new JTabbedPane();
tab.setFont(MyFont.getMyFont());
JPanel jp=ViewFactory.getStudentManagerPanel();
tab.add("学生管理",jp);
centerPanel.add(tab);
}
public void createAdminTeacher(){
centerPanel.removeAll();
flag_index=0;
flag_student=0;
flag_teacher=1;
flag_user=0;
flag_admin_course=0;
JTabbedPane tab=new JTabbedPane();
tab.setFont(MyFont.getMyFont());
JPanel jp=ViewFactory.getTeacherManagerPanle();
tab.add("教师管理",jp);
centerPanel.add(tab);
}
public void createAdminCourse(){
centerPanel.removeAll();
flag_index=0;
flag_student=0;
flag_teacher=0;
flag_user=0;
flag_admin_course=1;
JTabbedPane tab=new JTabbedPane();
tab.setFont(MyFont.getMyFont());
JPanel jp=ViewFactory.getCourseManagerPanel();
tab.add("课程管理",jp);
centerPanel.add(tab);
}
public void createScore(){
centerPanel.removeAll();
flag_index=0;
flag_score=1;
flag_sechdule=0;
flag_course=0;
flag_user=0;
JTabbedPane tab=new JTabbedPane();
tab.setFont(MyFont.getMyFont());
JPanel jp=new JPanel();
if(student!=null){
jp=ViewFactory.getStudentScoreView(student);
}else{
jp=ViewFactory.getTeacherSocreView(teacher);
}
tab.add("成绩管理",jp);
centerPanel.add(tab);
}
public void createSechdule(){
centerPanel.removeAll();
flag_index=0;
flag_score=0;
flag_sechdule=1;
flag_course=0;
flag_user=0;
JTabbedPane tab=new JTabbedPane();
tab.setFont(MyFont.getMyFont());
JPanel jp=null;
if(student!=null){
jp=ViewFactory.getStudentCourseSechView(student);
tab.add("学生课表",jp);
}
if(teacher!=null){
jp=ViewFactory.getTeacherCourseSechView(teacher);
tab.add("教师课表",jp);
}
centerPanel.add(tab);
}
public void createCourse(){
centerPanel.removeAll();
flag_index=0;
flag_score=0;
flag_sechdule=0;
flag_course=1;
flag_user=0;
JTabbedPane tab=new JTabbedPane();
tab.setFont(MyFont.getMyFont());
JPanel jp1=null;
JPanel jp2=null;
if(student!=null){
jp1=ViewFactory.getStudentSelectCourseView(student);
jp2=ViewFactory.getCoursetAlView(student);
tab.add("选择课程", jp1);
tab.add("已选课程",jp2);
}else if(teacher!=null){
jp1=ViewFactory.getTeacherCourseView(teacher);
tab.add("安排课程",jp1);
}
centerPanel.add(tab);
}
public void createUser(){
centerPanel.removeAll();
flag_index=0;
flag_score=0;
flag_sechdule=0;
flag_course=0;
flag_user=1;
JTabbedPane tab=new JTabbedPane();
tab.setFont(MyFont.getMyFont());
if(student!=null){
JPanel jp1=ViewFactory.getStudentInformationPanel(student);
JPanel jp2=ViewFactory.getStudentUpdatePswView(student);
tab.add("基本信息", jp1);
tab.add("修改密码",jp2);
centerPanel.add(tab);
}else if(teacher!=null){
JPanel jp1=ViewFactory.getTeacherInformationView(teacher);
JPanel jp2=ViewFactory.getTeacherUpdatePswView(teacher);
tab.add("基本信息", jp1);
tab.add("修改密码",jp2);
centerPanel.add(tab);
}
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
if(e.getSource()==jl_index){
if(flag_index==0){
this.createIndex();
}
}else if(e.getSource()==jl_score){
if(flag_score==0){
this.createScore();
}
}else if(e.getSource()==jl_sechdule){
if(flag_sechdule==0){
this.createSechdule();
}
}else if(e.getSource()==jl_course){
if(flag_course==0){
this.createCourse();
}
}else if(e.getSource()==jl_user){
if(flag_user==0){
this.createUser();
}
}else if(e.getSource()==jl_student){
if(flag_student==0){
this.createAdminStudent();
}
}else if(e.getSource()==jl_teacher){
if(flag_teacher==0){
this.createAdminTeacher();
}
}else if(e.getSource()==jl_admin_course){
if(flag_admin_course==0){
this.createAdminCourse();
}
}
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent e) {
if(e.getSource()==jl_index){
jl_index.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jl_index.setText("<html><font color='#336699' style='font-weight:bold'>" + "首页 | " + "</font></html>");
}else if(e.getSource()==jl_score){
jl_score.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jl_score.setText("<html><font color='#336699' style='font-weight:bold'>" + "成绩管理 | " + "</font></html>");
}else if(e.getSource()==jl_sechdule){
jl_sechdule.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jl_sechdule.setText("<html><font color='#336699' style='font-weight:bold'>" + "课表管理 | " + "</font></html>");
}else if(e.getSource()==jl_course){
jl_course.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jl_course.setText("<html><font color='#336699' style='font-weight:bold'>" + "选课管理 | " + "</font></html>");
}else if(e.getSource()==jl_user){
jl_user.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jl_user.setText("<html><font color='#336699' style='font-weight:bold'>" + "用户管理 | " + "</font></html>");
}else if(admin!=null&&e.getSource()==jl_student){
jl_student.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jl_student.setText("<html><font color='#336699' style='font-weight:bold'>" + "学生管理 | " + "</font></html>");
}else if(admin!=null&&e.getSource()==jl_teacher){
jl_teacher.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jl_teacher.setText("<html><font color='#336699' style='font-weight:bold'>" + "教师管理 | " + "</font></html>");
}else if(admin!=null&&e.getSource()==jl_admin_course){
jl_admin_course.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jl_admin_course.setText("<html><font color='#336699' style='font-weight:bold'>" + "课程管理 | " + "</font></html>");
}else{
}
}
@Override
public void mouseExited(MouseEvent e) {
if(e.getSource()==jl_index){
jl_index.setText("<html><font color='black'>" + "首页 | " + "</font></html>");
}else if(e.getSource()==jl_score){
jl_score.setText("<html><font color='black' >" + "成绩管理 | " + "</font></html>");
}else if(e.getSource()==jl_sechdule){
jl_sechdule.setText("<html><font color='black'>" + "课表管理 | " + "</font></html>");
}else if(e.getSource()==jl_course){
jl_course.setText("<html><font color='black'>" + "选课管理 | " + "</font></html>");
}else if(e.getSource()==jl_user){
jl_user.setText("<html><font color='black'>" + "用户管理 | " + "</font></html>");
}else if(admin!=null&&e.getSource()==jl_student){
jl_student.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jl_student.setText("<html><font color='black'>" + "学生管理 | " + "</font></html>");
}else if(admin!=null&&e.getSource()==jl_teacher){
jl_teacher.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jl_teacher.setText("<html><font color='black'>" + "教师管理 | " + "</font></html>");
}else if(admin!=null&&e.getSource()==jl_admin_course){
jl_admin_course.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jl_admin_course.setText("<html><font color='black'>" + "课程管理 | " + "</font></html>");
}else{
}
}
}
5、项目内容包含
6、项目获取
6.1 方式一
私信或者扫描下方二维码获取项目源码。
6.2 方式二
点击此处直接获取项目源码。