歡迎來到裝配圖網(wǎng)! | 幫助中心 裝配圖網(wǎng)zhuangpeitu.com!
裝配圖網(wǎng)
ImageVerifierCode 換一換
首頁 裝配圖網(wǎng) > 資源分類 > DOC文檔下載  

JAVA學(xué)生信息管理系統(tǒng)源碼

  • 資源ID:59542854       資源大?。?span id="eagk6ss" class="font-tahoma">59KB        全文頁數(shù):14頁
  • 資源格式: DOC        下載積分:0積分
快捷下載 游客一鍵下載
會(huì)員登錄下載
微信登錄下載
三方登錄下載: 微信開放平臺(tái)登錄 支付寶登錄   QQ登錄   微博登錄  
二維碼
微信掃一掃登錄
下載資源需要0積分
郵箱/手機(jī):
溫馨提示:
用戶名和密碼都是您填寫的郵箱或者手機(jī)號,方便查詢和重復(fù)下載(系統(tǒng)自動(dòng)生成)
支付說明:
本站最低充值0.01積分,下載本資源后余額將會(huì)存入您的賬戶,您可在我的個(gè)人中心查看。
驗(yàn)證碼:   換一換

 
賬號:
密碼:
驗(yàn)證碼:   換一換
  忘記密碼?
    
友情提示
2、PDF文件下載后,可能會(huì)被瀏覽器默認(rèn)打開,此種情況可以點(diǎn)擊瀏覽器菜單,保存網(wǎng)頁到桌面,就可以正常下載了。
3、本站不支持迅雷下載,請使用電腦自帶的IE瀏覽器,或者360瀏覽器、谷歌瀏覽器下載即可。
4、本站資源下載后的文檔和圖紙-無水印,預(yù)覽文檔經(jīng)過壓縮,下載后原文更清晰。
5、試題試卷類文檔,如果標(biāo)題沒有明確說明有答案則都視為沒有答案,請知曉。

JAVA學(xué)生信息管理系統(tǒng)源碼

精選優(yōu)質(zhì)文檔-傾情為你奉上/ AddStuInfo.javapackage com.main;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.sql.Connection;import javax.swing.JButton;import javax.swing.JComboBox;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JTextField;import javax.swing.JOptionPane;import com.bean.Student;import com.dao.StudentDao;import com.db.DB;import com.main.DelteStudent.delAction;public class AddStuInfo extends JFrame StudentDao studao = new StudentDao();DB db = new DB();Connection conn = db.getConnection();JTextField snoText = null;JTextField snameText = null;JComboBox sexcom = null;JTextField ageText = null;JComboBox classcom = null;JComboBox departcom = null;public void init() / 窗體設(shè)計(jì)this.setLayout(null);this.setTitle("學(xué)生信息管理系統(tǒng)");this.setSize(500, 400);JLabel title = new JLabel("學(xué)生信息維護(hù)模塊-錄入數(shù)據(jù)");title.setBounds(180, 20, 200, 30);this.add(title);JLabel snoLabel = new JLabel("學(xué)號");snoText = new JTextField();snoLabel.setBounds(20, 60, 40, 25);snoText.setBounds(60, 60, 120, 25);this.add(snoLabel);this.add(snoText);JLabel snameLabel = new JLabel("姓名");snameText = new JTextField();snameLabel.setBounds(220, 60, 40, 25);snameText.setBounds(260, 60, 120, 25);this.add(snameLabel);this.add(snameText);JLabel sexlabel = new JLabel("性別");String sex = "男", "女" ;sexcom = new JComboBox(sex);sexlabel.setBounds(20, 90, 40, 25);sexcom.setBounds(60, 90, 120, 25);this.add(sexlabel);this.add(sexcom);JLabel ageLabel = new JLabel("年齡");ageText = new JTextField();ageLabel.setBounds(220, 90, 40, 25);ageText.setBounds(260, 90, 120, 25);this.add(ageLabel);this.add(ageText);JLabel classlabel = new JLabel("班級");String classes = "信息081", "信息082", "物流081" ;classcom = new JComboBox(classes);classlabel.setBounds(20, 120, 40, 25);classcom.setBounds(60, 120, 120, 25);this.add(classlabel);this.add(classcom);JLabel departlabel = new JLabel("學(xué)院");String depart = "造紙", "理學(xué)院", "機(jī)電學(xué)院" ;departcom = new JComboBox(depart);departlabel.setBounds(220, 120, 40, 25);departcom.setBounds(260, 120, 120, 25);this.add(departlabel);this.add(departcom);/ 錄入數(shù)據(jù)JButton addbtn = new JButton("錄入");addbtn.setBounds(150, 180, 60, 30);addbtn.addActionListener(new addAction();this.add(addbtn);/ 返回JButton backbtn = new JButton("返回");backbtn.setBounds(230, 180, 60, 30);backbtn.addActionListener(new BackAction ();this.add(backbtn);this.setLocationRelativeTo(null); / 使窗體居中this.setResizable(false);/ 固定窗體大小this.setVisible(true); / 設(shè)置窗體可見/this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); / 窗體關(guān)閉時(shí),程序結(jié)束/ 獲取文本框或選擇框的值public Student getStudent() Student stu = new Student();String sno = snoText.getText(); / 獲取輸入的學(xué)號String sname = snameText.getText(); / 獲取姓名String sex = (String) sexcom.getSelectedItem();/ 獲取性別int age = Integer.parseInt(ageText.getText().trim(); / 獲取年齡String className = (String) classcom.getSelectedItem(); / 獲取班級String depart = (String) departcom.getSelectedItem(); / 獲取學(xué)院/ 封裝信息stu.setSno(sno);stu.setName(sname);stu.setSex(sex);stu.setAge(age);stu.setClassName(className);stu.setDepart(depart);return stu;public static void main(String args) AddStudent addstu = new AddStudent();addstu.init();/ 錄入的監(jiān)聽器class addAction implements ActionListener public void actionPerformed(ActionEvent e) Student stu = getStudent();boolean b = studao.save(stu, conn);if (b) JOptionPane.showMessageDialog(null, "數(shù)據(jù)錄入成功!"); else JOptionPane.showMessageDialog(null, "學(xué)號已存在,數(shù)據(jù)錄入失?。?quot;);class BackAction implements ActionListenerpublic void actionPerformed(ActionEvent e) MainFrame m=new MainFrame (); m.init();/DelStuInfo.javapackage com.main;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.sql.Connection;import java.sql.SQLException;import java.util.Vector;import javax.swing.JButton;import javax.swing.JComboBox;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import com.bean.Student;import com.dao.StudentDao;import com.db.DB;import com.main.AddStudent.BackAction;/刪除學(xué)生信息public class DelStuInfo extends JFrame StudentDao studao = new StudentDao();DB db = new DB();Connection conn = db.getConnection();JComboBox snocom = null;public void init() / 窗體設(shè)計(jì)this.setLayout(null);this.setTitle("學(xué)生信息管理系統(tǒng)");this.setSize(500, 400);JLabel title = new JLabel("學(xué)生信息維護(hù)模塊-刪除數(shù)據(jù)");title.setBounds(180, 20, 200, 30);this.add(title);/ 選擇學(xué)號JLabel snoLabel = new JLabel("請選擇要?jiǎng)h除學(xué)生信息的學(xué)號");snoLabel.setBounds(20, 60, 200,25);this.add(snoLabel);try Vector vec = studao.getSno();snocom = new JComboBox(vec); / 將數(shù)據(jù)庫里的學(xué)號信息裝入下拉框中snocom.setBounds(30, 90, 150, 25); catch (SQLException e) e.printStackTrace();this.add(snocom);/ 刪除數(shù)據(jù)JButton delbtn = new JButton("刪除");delbtn.setBounds(100, 180, 60, 30);delbtn.addActionListener(new delAction();this.add(delbtn);/ 返回JButton backbtn = new JButton("返回");backbtn.setBounds(180, 180, 60, 30);backbtn.addActionListener(new BackAction ();this.add(backbtn);this.setLocationRelativeTo(null); / 使窗體居中this.setResizable(false);/ 固定窗體大小this.setVisible(true); / 設(shè)置窗體可見/this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); / 窗體關(guān)閉時(shí),程序結(jié)束public static void main(String args) DelteStudent delstu = new DelteStudent();delstu.init();/ 刪除的監(jiān)聽器class delAction implements ActionListener public void actionPerformed(ActionEvent e) String delsno = (String) snocom.getSelectedItem();boolean b = studao.delete(delsno, conn);if (b) JOptionPane.showMessageDialog(null, "刪除錄入成功!"); else JOptionPane.showMessageDialog(null, "刪除錄入失??!");class BackAction implements ActionListenerpublic void actionPerformed(ActionEvent e) MainFrame m=new MainFrame (); m.init();package com.main;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.sql.Connection;import java.sql.SQLException;import java.util.Vector;import javax.swing.JButton;import javax.swing.JComboBox;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JTextField;import javax.swing.JOptionPane;import com.bean.Student;import com.dao.StudentDao;import com.db.DB;import com.main.AddStudent.BackAction;import com.main.DelteStudent.delAction;public class EditFrame extends JFrame StudentDao studao = new StudentDao();DB db = new DB();Connection conn = db.getConnection();JTextField snameText = null;JComboBox sexcom = null;JTextField ageText = null;JComboBox classcom = null;JComboBox departcom = null;JComboBox snocom = null;public void init() / 窗體設(shè)計(jì)this.setLayout(null);this.setTitle("學(xué)生信息管理系統(tǒng)");this.setSize(500, 400);JLabel title = new JLabel("學(xué)生信息維護(hù)模塊-修改數(shù)據(jù)");title.setBounds(180, 20, 200, 30);this.add(title);JLabel snoLabel = new JLabel("學(xué)號");snoLabel.setBounds(20, 60, 40, 25);this.add(snoLabel);try Vector vec = studao.getSno();snocom = new JComboBox(vec); / 將數(shù)據(jù)庫里的學(xué)號信息裝入下拉框中snocom.setBounds(60, 60, 120, 25); catch (SQLException e) e.printStackTrace();this.add(snocom);JLabel snameLabel = new JLabel("姓名");snameText = new JTextField();snameLabel.setBounds(220, 60, 40, 25);snameText.setBounds(260, 60, 120, 25);this.add(snameLabel);this.add(snameText);JLabel sexlabel = new JLabel("性別");String sex = "男", "女" ;sexcom = new JComboBox(sex);sexlabel.setBounds(20, 90, 40, 25);sexcom.setBounds(60, 90, 120, 25);this.add(sexlabel);this.add(sexcom);JLabel ageLabel = new JLabel("年齡");ageText = new JTextField();ageLabel.setBounds(220, 90, 40, 25);ageText.setBounds(260, 90, 120, 25);this.add(ageLabel);this.add(ageText);JLabel classlabel = new JLabel("班級");String classes = "信息081", "信息082", "物流081" ;classcom = new JComboBox(classes);classlabel.setBounds(20, 120, 40, 25);classcom.setBounds(60, 120, 120, 25);this.add(classlabel);this.add(classcom);JLabel departlabel = new JLabel("學(xué)院");String depart = "造紙", "理學(xué)院", "機(jī)電學(xué)院" ;departcom = new JComboBox(depart);departlabel.setBounds(220, 120, 40, 25);departcom.setBounds(260, 120, 120, 25);this.add(departlabel);this.add(departcom);/ 修改JButton editbtn = new JButton("修改");editbtn.setBounds(150, 180, 60, 30);editbtn.addActionListener(new editAction();this.add(editbtn);/ 返回JButton backbtn = new JButton("返回");backbtn.setBounds(220, 180, 60, 30);backbtn.addActionListener(new BackAction ();this.add(backbtn);this.setLocationRelativeTo(null); / 使窗體居中this.setResizable(false);/ 固定窗體大小this.setVisible(true); / 設(shè)置窗體可見/ this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); / 窗體關(guān)閉時(shí),程序結(jié)束/ 獲取文本框或選擇框的值public Student getStudent() Student stu = new Student();String sno = (String) snocom.getSelectedItem(); / 獲取輸入的學(xué)號String sname = snameText.getText(); / 獲取姓名String sex = (String) sexcom.getSelectedItem();/ 獲取性別int age = Integer.parseInt(ageText.getText().trim(); / 獲取年齡String className = (String) classcom.getSelectedItem(); / 獲取班級String depart = (String) departcom.getSelectedItem(); / 獲取學(xué)院/ 封裝信息stu.setSno(sno);stu.setName(sname);stu.setSex(sex);stu.setAge(age);stu.setClassName(className);stu.setDepart(depart);return stu;public static void main(String args) EditFrame editstu = new EditFrame();editstu.init();/ 修改監(jiān)聽器class editAction implements ActionListener public void actionPerformed(ActionEvent e) Student stu = getStudent();boolean b = studao.edit(stu.getSno(), stu.getName(), stu.getSex(),stu.getAge(), stu.getClassName(), stu.getDepart(), conn);if (b) JOptionPane.showMessageDialog(null, "數(shù)據(jù)修改成功!"); else JOptionPane.showMessageDialog(null, "數(shù)據(jù)修改失??!");class BackAction implements ActionListenerpublic void actionPerformed(ActionEvent e) MainFrame m=new MainFrame (); m.init();專心-專注-專業(yè)

注意事項(xiàng)

本文(JAVA學(xué)生信息管理系統(tǒng)源碼)為本站會(huì)員(風(fēng)***)主動(dòng)上傳,裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對上載內(nèi)容本身不做任何修改或編輯。 若此文所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng)(點(diǎn)擊聯(lián)系客服),我們立即給予刪除!

溫馨提示:如果因?yàn)榫W(wǎng)速或其他原因下載失敗請重新下載,重復(fù)下載不扣分。




關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號:ICP2024067431-1 川公網(wǎng)安備51140202000466號


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺(tái),本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng),我們立即給予刪除!