欢迎来到天天文库
浏览记录
ID:41707288
大小:62.88 KB
页数:44页
时间:2019-08-30
《数据库选修课程管理系统》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、packageyangxu;importjava•awt•*;importjava•awt•event•*;importjavax•swing•*;importjavax.swing.table.AbstractTableModel;importjava•applet.Applet;importjava•applet•AudioClip;importjava.io.importjava.net.MalformedURLException;importjava•net•URI;importjava•net•URL;importjava.sql.*;importsu
2、n•Audio.*;publicclassMain{publicstaticvoidmain(String[]args){newLogin();七可{Filef=newFile(”D://音乐//logic.mid”);URIu=f・toURI();URLr=null;r=u.toURL();AudioClipm=Applet.newAudioClip(r);m.loop();}catch(MalformedURLExceptione){//TODOAuto-generatedcatchbloce•printStackTrace();}}}classLogine
3、xtendsJFrame{JLabellLogin,IKeyzlLoginlnform;JTextFieldtextLogin,textKey;JPasswordFieldpassField;JButtonbLogin,bCancel;Choiceidentify;publicLogin(){setTitle(”选修课程管理系统”);intwidth=getWidth();intheight=getHeight();int(Toolkit.getDefaultToolkit().getScreenSize().width-width)/2;inth=(Toolk
4、it-getDefaultToolkit()•getScreenSize().height-height)/2;setLocation(wAh);setLayout(newFlowLayout(FlowLayout.CENTER.100,25));lLoginInform=newJLmbel(”登陆身份:");identify=newChoice();identify・add(”学生");identify・add(”教师");identify.add(”管理员“);add(lLoginlnform);add(identify);lLogin=newJLabe丄(
5、”账号:”);add(lLogin);textLogin=newJTextField(nHz7);add(textLogin);lKey=newJLabe丄(”密码:”);add(IKey);passField=newJPasswordField(7);add(passField);bLogin=newJButton("背陆”);bLogin•addActionListener(newActionListener(){publicvoidactionPerformed(ActionEvente){booleanflag;if(identify.getSelect
6、edltem().equals(H学生“)&&(textLogin•getText())•equals(11studentn)){charpass[]=passField.getPmssword();for(inti=0;i<6;){if(pass[i]==i+l)flag=true;else{flag=false;break;}}if(flag=true){dispose();newStudent()•setVisible(true);if(identify.getSelecteditem().equals(H管理员”)&&(textLogin•getText
7、())•equals(nmanagerH)){charpass[]=passField.getPassword();for(inti=0;i<6;){if(pass[i]==i+l)flag=true;else{flag=false;break;}}if(flag=true){dispose();newStudent().setVisible(true);}}if(identify.getSelectedltem()・equals(n教师“)&&(textLogin•getText())•equals(nteacherH)){charpass[]=passFie
8、ld.getPasswo
此文档下载收益归作者所有