日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > windows >内容正文

windows

java编写管理系统_用java编写学生信息管理系统

發(fā)布時(shí)間:2024/9/27 windows 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java编写管理系统_用java编写学生信息管理系统 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

《用java編寫學(xué)生信息管理系統(tǒng)》由會員分享,可在線閱讀,更多相關(guān)《用java編寫學(xué)生信息管理系統(tǒng)(7頁珍藏版)》請?jiān)谌巳宋膸炀W(wǎng)上搜索。

1、用java編寫學(xué)生信息管理系統(tǒng)import .*;importimport .*;import .*;import .*;class Stude nt impleme ntsString nu mber, name,specialty,grade,borth,sex;public Stude nt();public void setNumber(Stri ng nu mber) =nu mber;public String getNumber() retur n nu mber;public void setName(Stri ng n ame) =n ame;public String ge。

2、tName() retur n n ame;public void setSex(Stri ng sex) =sex;public String getSex() retur n sex;public void setSpecialty(Stri ng specialty) =specialty;public String getSpecialty() retur n specialty;public void setGrade(Stri ng grade) =grade;public String getGrade() retur n grade;public void setBorth(S。

3、tri ng borth) =borth;public Stri ng getBorth() retur n borth;public class Stude ntMa nager exte nds JFrameJLabel lb=new JLabel (錄入請先輸入記錄,查詢、刪除請先輸入學(xué)號,修改是對查詢” +內(nèi)容改后的保存! ”);static JTextField Jnu mber, Jn ame,Jspecialty,Jgrade,Jborth;static JRadioButt on boy,girl;static Butt on Group group=nu II;static 。

4、JButton Log in, select,delete,update,show;static JPa nel p1,p2,p3,p4,p5,p6,pv,ph;static Stude nt stude nt=n ull;static Hashtable Shashtable=nu II;static File file=n ull;static File In putStream inOne=n ull;static Object In putStream in Two=n ull;static FileOutputStream out One=n ull;static ObjectOut。

5、putStream outTwo=n ull;public Stude ntMa nager()super(學(xué)生基本信息管理系統(tǒng)”);Jnu mber =new JTextField(10);Jname =new JTextField(10); Jspecialty=new JTextField(10); Jgrade=new JTextField(10); Jborth=new JTextField(10); group=new ButtonGroup(); boy=new JRadioButton( 男 ,true); girl=new JRadioButton( 女 ,false); (。

6、boy);(girl);Login=new JButton( 錄入 ); select=new JButton( 查詢 ); delete=new JButton( 刪除 ); update=new JButton( 修改 ); show=new JButton( 顯示 ); (new InputAct();(new InquestAct();(new ModifyAct();(new DeleteAct();(new ShowAct();(false); p1=new JPanel();(new JLabel(學(xué)號:,);(Jnumber); p2=new JPanel(); (new JL。

7、abel(姓名:,);(Jname); p3=new JPanel();(new JLabel(性別:,);(boy);(girl);p4=new JPanel();(new JLabel(專業(yè):,);(Jspecialty); p5=new JPanel();(new JLabel(年級:,);(Jgrade); p6=new JPanel();(new JLabel(出生:,);(Jborth); pv=new JPanel();(new GridLayout(6,1);(p1);(p2);(p3);(p4);(p5);(p6);ph=new JPanel();(Login);(selec。

8、t);(update);(delete);(show);file=new File( 學(xué)生信息 .txt);Shashtable=new Hashtable();if(!()tryFileOutputStream out=new FileOutputStream(file);ObjectOutputStream objectOut=new ObjectOutputStream(out); (Shashtable);();();catch(IOException e)Container con=getContentPane();(new BorderLayout();(lb, ;(pv, ;(p。

9、h, ;setDefaultCloseOperation(EXIT_ON_CLOSE);setBounds(100,100,600,300);setVisible(true);public static void main(String args) new StudentManager();class InputAct implements ActionListenerpublic void actionPerformed(ActionEvent e)(false);String number=;number=();if()0)tryinOne=new FileInputStream(file。

10、);inTwo=new ObjectInputStream(inOne);Shashtable=(Hashtable)();();();catch(Exception ee) 創(chuàng)建散列表出現(xiàn)問題! ); if(number)String warning= 該生信息已存在,請到修改頁面修改! (null,warning, 警告 ,Jquals(” 男)(true);else(true);else(false);String warning= 該學(xué)號不存在! ;(null,warning,警告 ,;else(false);String warning= 必須輸入學(xué)號! ;(null,warning。

11、,警告 ,;class ModifyAct implements ActionListener public void actionPerformed(ActionEvent e)String number=();String name=();String specialty=();String grade=();String borth=();String sex=null;if()sex=();elsesex=();Student 學(xué)生 =new Student();學(xué)生 .setNumber(number);學(xué)生 .setName(name);學(xué)生 .setSpecialty(speci。

12、alty);學(xué)生 .setGrade(grade);學(xué)生 .setBorth(borth);學(xué)生 .setSex(sex);tryoutOne=new FileOutputStream(file);outTwo=new ObjectOutputStream(outOne);(number, 學(xué)生 );(Shashtable);();();(null);(null);(null);(null);(null);catch(Exception ee)錄入修改出現(xiàn)異常 !);(false);class DeleteAct implements ActionListenerpublic void act。

13、ionPerformed(ActionEvent e)(false);String number=();if()0)tryinOne=new FileInputStream(file); inTwo=new ObjectInputStream(inOne); Shashtable=(Hashtable)();();();catch(Exception ee)if(number)Student stu=(Student)(number);();();();();if().equals(” 男)(true);else(true);String m=確定要刪除該學(xué)生的記錄嗎?”int ok=(nul。

14、l,m, 確認(rèn) ,J Jif(ok=(number);tryoutOne=new FileOutputStream(file);outTwo=new ObjectOutputStream(outOne);(Shashtable);();();(null);(null);(null);(null);(null);catch(Exception ee)else if(ok=(null);(null);(null);(null);(null);elseString warning= 該學(xué)號不存在! ;(null,warning,n Ak n . 警告 ,;elseString warning= 必須。

15、輸入學(xué)號! ;(null,warning,Ap, n . 警告 ,;class ShowAct implements ActionListenerpublic void actionPerformed(ActionEvent e)new StudentShow(file);class StudentShow extends JDialogHashtable 學(xué)生散列表 = null;JTextArea 顯示 =null;FileInputStream inOne=null;ObjectInputStream inTwo=null;File file=null;public StudentSho。

16、w(File file)super(new JFrame(), 顯示對話框 );=file;顯示 =new JTextArea(16,30);tryinOne=new FileInputStream(file);inTwo=new ObjectInputStream(inOne);學(xué)生散列表 =(Hashtable)();();();catch(Exception ee)n);if(學(xué)生散列表.isEmpty()顯示.append(”目前還沒有學(xué)生的信息記錄! else顯示.setText(”學(xué)號姓名性別專業(yè)年級出生n”);for(Enumeration enm= 學(xué)生散列表 .element。

17、s();();)Student stu=(Student)();String sex=;if().equals(男)sex=男;else sex=女;String str=()+,+()+,+sex+,+()+,+()+,+()+n;顯示 .append(str);JScrollPane scroll=new JScrollPane顯示);Container con=getContentPane();(Center,scroll);();setVisible(true);setBounds(200,200,400,300);addWindowListener(new WindowAdapter()public void windowClosing(WindowEvent e)setVisible(false);。

總結(jié)

以上是生活随笔為你收集整理的java编写管理系统_用java编写学生信息管理系统的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。