求用Java编写的学生成绩管理系统的完整代码

================================================================================ 学生成绩管理系统 1 输入记录 2 输出所有记录 3 按平均成绩排序并输出 4 查找记录 5 统计各分数段人数 6 删除记录 0 退出================================================================================这是运行界面,谢谢了 ,邮箱[email protected]

第1个回答  2017-05-26
package jdbcproj;
import java.sql.*;
import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.awt.event.ActionEvent;

public class MainFrame extends JFrame {

private JPanel contentPane;
private JTextField txtname;
private JTextField txtpassword;


/**
 * Launch the application.
 */
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MainFrame frame = new MainFrame();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
 * Create the frame.
 */
public MainFrame() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 661, 399);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);

JLabel lblNewLabel = new JLabel("\u7528\u6237\u540D");
lblNewLabel.setBounds(114, 51, 72, 18);
contentPane.add(lblNewLabel);

JLabel lblNewLabel_1 = new JLabel("\u5BC6\u7801");
lblNewLabel_1.setBounds(114, 106, 72, 18);
contentPane.add(lblNewLabel_1);

txtname = new JTextField();
txtname.setBounds(261, 48, 86, 24);
contentPane.add(txtname);
txtname.setColumns(10);

txtpassword = new JTextField();
txtpassword.setBounds(261, 103, 86, 24);
contentPane.add(txtpassword);
txtpassword.setColumns(10);

JButton btnadd = new JButton("\u589E\u52A0");
btnadd.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(txtname.getText().equals("")||txtpassword.getText().equals(""))
{
JOptionPane.showMessageDialog(getContentPane(), "用户名和密码不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);
}
else{
Users u=new Users();
u.setPwd(txtpassword.getText());
u.setUsername(txtname.getText());
UserDAO usdo=new UserDAO();
usdo.addUser(u);
}
}
});
btnadd.setBounds(45, 205, 113, 27);
contentPane.add(btnadd);

JButton btndelete = new JButton("\u5220\u9664");
btndelete.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if(txtname.getText().equals(""))
{
JOptionPane.showMessageDialog(getContentPane(), "用户名不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);
}
else{
UserDAO usdo=new UserDAO();
usdo.delUser(txtname.getText());;
}
}
});
btndelete.setBounds(172, 205, 113, 27);
contentPane.add(btndelete);

JButton btnupdate = new JButton("\u4FEE\u6539");
btnupdate.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(txtname.getText().equals("")||txtpassword.getText().equals(""))
{
JOptionPane.showMessageDialog(getContentPane(), "用户名和密码不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);
}
else{
Users u=new Users();
u.setPwd(txtpassword.getText());
u.setUsername(txtname.getText());
UserDAO usdo=new UserDAO();
usdo.updateUser(u);;
}
}
});
btnupdate.setBounds(300, 205, 113, 27);
contentPane.add(btnupdate);

JButton btnfind = new JButton("\u67E5\u8BE2");
btnfind.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(txtname.getText().equals(""))
{
JOptionPane.showMessageDialog(getContentPane(), "用户名不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);
}
else{
Users u=new Users();
UserDAO usdo=new UserDAO();
u=usdo.findUser(txtname.getText(), txtpassword.getText());
if(u!=null){
JOptionPane.showMessageDialog(getContentPane(), "该用户存在!","提示信息框",JOptionPane.WARNING_MESSAGE);
}
else{
JOptionPane.showMessageDialog(getContentPane(), "该用户不存在!","提示信息框",JOptionPane.WARNING_MESSAGE);
}
}
}
});
btnfind.setBounds(427, 205, 113, 27);
contentPane.add(btnfind);
//记得要写这个
setVisible(true);
}

}

第2个回答  2015-07-03
10金就想别人帮你做,你还是好好学习,自己搞吧!
第3个回答  2015-07-03
如果真的需要可以联系我 这个挺简单的追问

怎么联系

追答

125819398

第4个回答  2015-07-03
一口价 200追问

heh

追答

楼主你别呵呵了 课程学又不好学 网上一搜一大堆
你这东西说难不难 说复杂也不复杂 不过就是麻烦 要真是有人有心帮你写了 你一个10分真心对不起人 出点幸苦费你应该的
二个别人没帮你写 给你网上拷贝一份 那你就更要给钱了 一般都是老板在这么大面子 放着面前的东西叫服务员拿过来 顺便给点小费 您说呢?