javaswing成绩管理系统_Javaswing学⽣成绩管理系统Java swing 学⽣成绩管理系统
Java swing 学⽣成绩管理系统
ps:代码已上传⽹盘提取码:1111,内有JDBC的jar包,管理员登录账号:admin密码:admin
功能需求
1,学⽣可查⾃⼰的分数,可以选课
2,教师可以为学⽣输⼊分数
3,教师可查⾃⼰所授课相应学⽣的成绩
4,管理员可以对教师,学⽣信息的增删改查
5,⽤数据库存储信息
效果图
登录界⾯
管理员功能选项
管理员对教师的操作
部分代码
连接数据库
private static Connection getConn() {
String driver = "sql.cj.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/Information?serverTimezone=UTC"; String username = "root";
String password = "";
Connection conn = null;
try {
Class.forName(driver); //classLoader,加载对应驱动
conn = (Connection) Connection(url, username, password); } catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
return conn;
}
实体类
public class Score {
private int id;
private String subject;
private String subjectTeacher;
private String member;
private int result;
public Score() {
}
public Score(int id, String subject, String subjectTeacher, String member,int result) { this.id = id;
this.subject = subject;
this.subjectTeacher = subjectTeacher;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getSubjectTeacher() {
return subjectTeacher;
}
public void setSubjectTeacher(String subjectTeacher) {
this.subjectTeacher = subjectTeacher;
}
public String getMember() {
javaswing酷炫界面return member;
}
public void setMember(String member) {
}
public int getResult() {
return result;
}
public void setResult(int result) {
}
}
登录
public class Login {
private JFrame jFrame;
private JPanel jPanel;
private JLabel user;
private JLabel password;
private JTextField usertxt;
private JTextField passwordtxt;
private JButton login;
private JButton registered;
public static String subject;
public static int id;
public void show(){
jFrame = new JFrame("学⽣成绩管理系统");
jFrame.setBounds(700,200,400,300);
jFrame.setDefaultCloseOperation(jFrame.EXIT_ON_CLOSE); jFrame.add(panel());
jFrame.setVisible(true);
}
public JPanel panel(){
jPanel = new JPanel(null);
user = new JLabel("⽤户名");
user.setBounds(50,50,50,30);
jPanel.add(user);
usertxt = new JTextField();
usertxt.setBounds(120,50,100,30);
jPanel.add(usertxt);
password = new JLabel("密码");
password.setBounds(50,100,50,30);
jPanel.add(password);
passwordtxt = new JTextField();
passwordtxt.setBounds(120,100,100,30);
jPanel.add(passwordtxt);
login = new JButton("登录");
login.setBounds(80,150,70,30);
jPanel.add(login);
registered = new JButton("注册");
registered.setBounds(170,150,70,30);
jPanel.add(registered);
login.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
String user = Text();
String password = Text();
for (int i = 0; i
//学⽣
if (user.equals(StudentInformationsql.studata[i][0]+"")&password.equals(StudentInformationsql.studata[i][4]+"")){
id = Integer.parseInt(user);
new com.window.student.Menue().show();
jFrame.setVisible(false);
break;
//教师
}else if (user.adata[i][0]+"")&password.adata[i][5]+"")){ subject = adata[i][2]+"";
new acher.Menue().show();
jFrame.setVisible(false);
break;
//管理员
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论