第一范文网 - 专业文章范例文档资料分享平台

学生成绩管理系统-数据库课程设计

来源:用户分享 时间:2025/5/22 23:10:31 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

button2 = new Button(\删除\。 button3 = new Button(\修改\。 button4 = new Button(\查询\。 button5 = new Button(\返回\。 button6 = new Button(\退出\。 box = Box.createHorizontalBox()。 box.add(button1)。

box.add(Box.createHorizontalStrut(8))。 box.add(button2)。

box.add(Box.createHorizontalStrut(8))。 box.add(button3)。

box.add(Box.createHorizontalStrut(8))。 box.add(button4)。

box.add(Box.createHorizontalStrut(8))。 box.add(button5)。

box.add(Box.createHorizontalStrut(8))。 box.add(button6)。

button1.addActionListener(this)。 button2.addActionListener(this)。 button3.addActionListener(this)。 button4.addActionListener(this)。 button5.addActionListener(this)。 button6.addActionListener(this)。

addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose()。 } })。

bg = new ImageIcon(\。 JLabel label = new JLabel(bg)。

label.setBounds(0, 0, bg.getIconWidth(), bg.getIconHeight())。 imagePanel = (JPanel) frame.getContentPane()。 imagePanel.setOpaque(false)。

imagePanel.setLayout(new FlowLayout())。 imagePanel.add(p1, BorderLayout.NORTH)。 imagePanel.add(box, BorderLayout.CENTER)。

frame.getLayeredPane().setLayout(null)。

frame.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE))。 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)。//设置关闭后状态 frame.setSize(bg.getIconWidth(), bg.getIconHeight())。

}

frame.setBounds(200, 200, 500, 300)。

frame.setResizable(false)。//设置窗口大小不可改变 frame.setVisible(true)。 validate()。

public void actionPerformed(ActionEvent e) { if (e.getSource() == button6) { System.exit(0)。 } if (e.getSource() == button1) { new charu()。 } if (e.getSource() == button2) { new shanchu()。 } if (e.getSource() == button3) { new xiugai()。 } if (e.getSource() == button4) { new chaxun()。 } if (e.getSource() == button5) { new denglu()。 frame.dispose()。 } else { } }

}

6.3 修改模块

首先由用户输入要修改地学生地成绩

主要代码:class xiugai extends JFrame implements ActionListener { JFrame frame = new JFrame(\修改成绩\。 JPanel imagePanel。 ImageIcon bg。 Button xiug。 TextField input1, input2, input3。

TextArea show。 Box box1, box2, box3。 Panel p1, p2。 int k, s1, j。

Connection con。 Statement sql。 int sum = 0。 ResultSet rs。

xiugai() { Toolkit kit = Toolkit.getDefaultToolkit()。 Image img = kit.getImage(\。 frame.setIconImage(img)。 p1 = new Panel()。 p2 = new Panel()。 xiug = new Button(\修改\。

input1 = new TextField(10)。 input2 = new TextField(10)。 input3 = new TextField(10)。 show = new TextArea(6, 43)。

Font f=new Font(\宋体\。 Label l1=new Label(\输入学号\。 l1.setFont(f)。

l1.setForeground(Color.blue)。 p1.add(l1)。

p1.add(new Label(\学号:\。 p1.add(input1)。

box1 = Box.createVerticalBox()。 box1.add(Box.createVerticalStrut(8))。 box1.add(new Label(\数学:\。 box1.add(Box.createVerticalStrut(8))。 box1.add(new Label(\英语:\。 box2 = Box.createVerticalBox()。 box2.add(input2)。

box2.add(Box.createVerticalStrut(8))。 box2.add(input3)。

box3 = Box.createHorizontalBox()。 box3.add(box1)。

box3.add(Box.createHorizontalStrut(1))。

box3.add(box2)。

Label l2=new Label(\输入成绩\。 l2.setFont(f)。

l2.setForeground(Color.blue)。 p2.add(l2)。 p2.add(box3)。

xiug.addActionListener(this)。 show.setEditable(false)。

bg = new ImageIcon(\。 JLabel label = new JLabel(bg)。

label.setBounds(0, 0, bg.getIconWidth(), bg.getIconHeight())。 imagePanel = (JPanel) frame.getContentPane()。 imagePanel.setOpaque(false)。

imagePanel.setLayout(new FlowLayout())。 imagePanel.add(p1)。 imagePanel.add(p2)。 imagePanel.add(xiug)。 imagePanel.add(show)。

frame.getLayeredPane().setLayout(null)。 frame.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE))。 //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)。 frame.setSize(bg.getIconWidth(), bg.getIconHeight())。 frame.setBounds(720, 220, 450, 390)。 frame.setResizable(false)。//设置窗口大小不可改变 frame.setVisible(true)。 validate()。 }

addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose()。 } })。

public void actionPerformed(ActionEvent ee) { String s1, s2, s3, insert1, number。 。 int m2, m3, math, english。 s1 = input1.getText()。 number = s1。 s2 = input2.getText()。

s3 = input3.getText()。 m2 = Integer.parseInt(s2)。 math = m2。

m3 = Integer.parseInt(s3)。 english = m3。

try { Class.forName(\。 } catch (ClassNotFoundException eee) { System.out.println(\。 } try { con = DriverManager.getConnection(\。 sql = con.createStatement()。 insert1 = \ + english + \。 sql.executeUpdate(insert1)。 show.setText(\你将了:\。 show.append(\学号为 \地学生 数学成绩更改为:\英语成绩更改为:\ + english)。 show.append(\。 } catch (SQLException e) { System.out.println(e)。 } } }

6.4 查找模块

首先由用户输入要查找地学生学号等,然后查找数据库中地该学生信息 主要代码:class chaxun extends JFrame implements ActionListener { JFrame frame = new JFrame(\查询记录\。 JPanel imagePanel。 ImageIcon bg。 Button xunzhao。 TextField input。 TextArea show。 Box box。 String s。

Connection con。

搜索更多关于: 学生成绩管理系统-数据库课程设计 的文档
学生成绩管理系统-数据库课程设计.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c1ejfo1sjs47zlrl1bkfq6d7jn4l91z0135r_3.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top