1、2、系统设计要能完成题目所要求的功能。3、编程简练,可用,尽可能的使系统的功能更加完善和全面4、使用说明书、流程图要清楚。二、解题思路1、课程设计的题目及简介有新生来报到,要逐个录入其信息,如:学生姓名,性别,出生日期,国籍。要求设计链表类来实现,并统计学生人数。文本界面为:1.添加学生信息2.删除学生信息3.查询学生信息4.修改学生信息5.学生信息保存6.退出2、设计说明总体结构我们采取模块化方式进行程序设计,要求程序的功能设计、数据结构设计及整体结构设计合理。也可根据自己对题目的理解增加新的功能模块。系统以菜单界面方式(至少采用文本菜单界面,如能采用图形菜单界面更好)工作,运行界面友好,演
2、示程序以用户和计算机的对话方式进行看题目要求,每一条记录包括一个学生的姓名、性别、出生日期、国籍。同时,应具备以下功能:1、删除功能:对指定学生的信息进行删除。2、修改功能:对指定学生的信息进行修改。3、查询功能:选择某种方式并输入该信息查询符合条件的学生信息。6、添加功能:添加新增学生信息。7、退出主菜单。三、 分析和设计 各功能模块的实现流程图:1增加学生信息判断*学生是否存在,若存在则错误,不存在则添加。具体流程如下图所示:流程图 2删除学生信息 删除学生的信息则必须对链表结点进行删除意味着将某个要删除结点前后的连续打断,去掉该结点,使前后指针变量重新连接,完成链表结点的删除任务 流程图
3、 3、查询学生信息按学生的学号进行查询 流程图:总功能模块图:四、主要源代码import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.sql.*;/主函数、主要类public class JCTX public static void main(String args) new Frm_Main(); / 实现类class Frm_Main implements ActionListener / throws IOException public JFrame frame; public Contain
4、er c; public JMenuBar menuBar; public JMenu mainMenu1; public JMenu mainMenu2; public JMenu mainMenu3; public JMenuItem subMenu1 = new JMenuItem5; public JMenuItem subMenu2 = new JMenuItem7; public JMenuItem subMenu3 = new JMenuItem2; JButton toolBarButton = new JButton8; public JToolBar toolBar; St
5、ring strTip = 查询您要找的学生记录., 添加学生记录.删除已有的学生记录修改学生记录., 使您修改的学生记录生效.使 您添加的学生记录生效.确认删除当前记录.退出本系统:) ; String id = new String(); String name = new String(); String sex = new String(); String birthday = new String(); String address = new String(); String birth = new String(); Connection conn; ResultSet rs;
6、Statement st; PreparedStatement pst; public JLabel idL = new JLabel(); public JLabel nameL = new JLabel(姓名: public JLabel sexL = new JLabel(性别: public JLabel jlbirth = new JLabel(出生年月: public JLabel jladdr = new JLabel(籍贯: public JTextField idT = new JTextField(); public JTextField nameT = new JText
7、Field(); public JTextField sexT = new JTextField(); public JTextField jtbirth = new JTextField(); public JTextField jtaddr = new JTextField(); public Frm_Main() frame = new JFrame(学生信息管理系统 c = frame.getContentPane(); c.setLayout(null); menuBar = new JMenuBar(); toolBar = new JToolBar(); toolBar.setF
8、loatable(false); frame.setJMenuBar(menuBar); frame.setResizable(false); mainMenu1 = new JMenu(管理 String str1 = 添加用户删除用户查询用户 退出 for (int i = 0; i 5; i+) if (i = 3) mainMenu1.addSeparator(); else subMenu1i = new JMenuItem(str1i); subMenu1i.addActionListener(this); mainMenu1.add(subMenu1i); menuBar.add
9、(mainMenu1); mainMenu2 = new JMenu(维护学生信息 String str2 = 查询记录添加记录删除记录修改记录提交修改提交添加 确认删除 7; subMenu2i = new JMenuItem(str2i); subMenu2i.addActionListener(this); mainMenu2.add(subMenu2i); menuBar.add(mainMenu2); mainMenu3 = new JMenu(帮助 String str3 = 帮助.关于. 2; subMenu3i = new JMenuItem(str3i); subMenu3i
10、.addActionListener(this); mainMenu3.add(subMenu3i); menuBar.add(mainMenu3); String strToolBar = 查询添加删除修改 toolBarButtoni = new JButton(strToolBari); toolBarButtoni.setToolTipText(strTipi); toolBarButtoni.addActionListener(this); toolBar.add(toolBarButtoni); toolBar.setLocation(0, 0); toolBar.setSize(
11、400, 30); c.add(toolBar); idL.setLocation(35, 40); idL.setSize(40, 20); / idL.setFont(new Font(宋体,Font.BOLD,12); c.add(idL); idT.setLocation(90, 40); idT.setSize(200, 20); / idT.setEnabled(false); c.add(idT); nameL.setLocation(35, 70); nameL.setSize(40, 20); c.add(nameL); nameT.setLocation(90, 70);
12、nameT.setSize(200, 20); c.add(nameT); sexL.setLocation(35, 100); sexL.setSize(40, 20); c.add(sexL); sexT.setLocation(90, 100); sexT.setSize(200, 20); c.add(sexT); jlbirth.setLocation(35, 160); jlbirth.setSize(40, 20); c.add(jlbirth); jtbirth.setLocation(90, 160); jtbirth.setSize(200, 20); c.add(jtbirth); jladdr.setLocation(35, 190); jladdr.setSize(40, 20); c.add(jladdr); jtaddr.setLocation(90, 190); jtaddr.setSize(200, 20); c.add(jtaddr); JLabel information = new JLa
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1