17java课程设计报告

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

《Java课程设计》报告课程名称:java课程设计设计题目:管理系统记事本专业班级:计算机工程系10计应班姓名:学号:1指导教师:设计时间:2011.12.19—12.30目录一、管理信息系统.........................................................................................................2(一)主要类的设计...............................................................................................2(二)功能分析.......................................................................................................2(三)功能图...........................................................................................................2(四)源程序代码与运行窗口...............................................................................2(1)登陆界面………………………………………………………………………………………2(2)注册登陆界面...........................................................6(3)用户界面.................................................................9二、记事本...................................................................................................................11(一)需求分析....................................................................................................11(二)概要设计.....................................................................................................11(三)源程序代码与运行窗口.............................................................................12(1)记事本主窗口.........................................................12(2)字体字号...............................................................18(3)查找....................................................................21四、聊天室...................................................................................................................22(一)设计思路.....................................................................................................22(二)源程序代码与运行端口.............................................................................22三、实训体会与小结..................................................................................................28五、附录.......................................................................................................................29一、管理信息系统(一)主要类的设计加载JDBC驱动程序1.使用Class.forName()语法:Class.forName(驱动程序名称);2.使用DriverManager.registerDriver()DriverManager.registerDriver(neworacle.jdbc.driver.OracleDriver());DriverManager类Connection接口Statement接口PreparedStatement接口CallableStatement接口ResultSet接口ResultSetMetaData接口DatabaseMetaData接口(二)功能分析实现从登陆界面连接数据库,登陆、注册(三)功能图(四)源程序代码与运行窗口(1)登陆界面a源代码://importjava.beans.Statement;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.Statement;打开登录界面连接数据库用户界面注册界面连接数据库写入用户信息publicclassNewJFrameextendsjavax.swing.JFrame{privatevoidinitComponents(){jLabel1=newjavax.swing.JLabel();jLabel2=newjavax.swing.JLabel();jButton1=newjavax.swing.JButton();jButton2=newjavax.swing.JButton();jButton3=newjavax.swing.JButton();jTextField1=newjavax.swing.JTextField();jTextField2=newjavax.swing.JTextField();jLabel3=newjavax.swing.JLabel();setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);jLabel1.setText(用户名:);jLabel2.setText(密码:);jButton1.setText(登陆);jButton1.addActionListener(newjava.awt.event.ActionListener(){publicvoidactionPerformed(java.awt.event.ActionEventevt){jButton1ActionPerformed(evt);}});jButton2.setText(重置);jButton2.addActionListener(newjava.awt.event.ActionListener(){publicvoidactionPerformed(java.awt.event.ActionEventevt){jButton2ActionPerformed(evt);}});jButton3.setText(注册);jButton3.addActionListener(newjava.awt.event.ActionListener(){publicvoidactionPerformed(java.awt.event.ActionEventevt){jButton3ActionPerformed(evt);}});jTextField1.setText(请输入用户名);jTextField2.setText(请输入密码);javax.swing.GroupLayoutlayout=newjavax.swing.GroupLayout(getContentPane());getContentPane().setLayout(layout);layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addGroup(javax.swing.GroupLayout.Alignment.LEADING,layout.createSequentialGroup().addGap(76,76,76).addComponent(jButton1)).addGroup(javax.swing.GroupLayout.Alignment.LEADING,layout.createSequentialGroup().addGap(66,66,66).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(jLabel2).addComponent(jLabel1)).addGap(18,18,18).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,false).addComponent(jTextField2).addComponent(jTextField1,javax.swing.GroupLayout.DEFAULT_SIZE,213,Short.MAX_VALUE))).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addGroup(layout.createSequentialGroup().addComponent(jButton2).addGap(38,38,38).addComponent(jButton3)).addComponent(jLabel3,javax.swing.GroupLayout.PREFERRED_SIZE,256,javax.swing.GroupLayout.PREFERRED_SIZE))))).addContainerGap(55,Short.MAX_VALUE)));layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGr

1 / 30
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功