资源描述:
《用java编教务系统的源码》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、专业技术资料分享importjava.awt.*;importjavax.swing.*;importjava.awt.event.*;importjavax.swing.border.*;importjavax.swing.JOptionPane;importjavax.swing.JLabel;importjavax.swing.JPanel;importjavax.swing.table.DefaultTableModel;importjavax.swing.table.TableColumn;import
2、java.sql.*;importjava.awt.GridLayout;publicclassmyStudent{publicmyStudent(){}publicstaticvoidmain(String[]args){//TODOcodeapplicationlogichereloginFramelf=newloginFrame();lf.setVisible(true);lf.addWindowListener(newWindowAdapter(){publicvoidwindowClosing(Wind
3、owEvente){System.exit(0);}});}}//主界面classmainFrameextendsJFrameimplementsActionListener{MenuBarmyMenuBar=newMenuBar();MenumyMenuFile,myMenuEdit,myMenuUser,myMenuAbout;MenuItemmiNew,miOpen,miSave,miSaveAs,miExit;MenuItemmiAdd,miEdit,miDel,miFind,miShow,miUser,
4、miAbout;publicJTabletable=newJTable();publicDefaultTableModelmm;publicmainFrame(){WORD资料下载可编辑专业技术资料分享myMenuFile=newMenu("文件");miNew=newMenuItem("新建");miOpen=newMenuItem("打开");miSave=newMenuItem("保存");miExit=newMenuItem("退出");//miNew.enable(false);//miOpen.ena
5、ble(false);//miSave.enable(false);//myMenuFile.add(miNew);//myMenuFile.add(miOpen);//myMenuFile.add(miSave);myMenuFile.add(miExit);myMenuEdit=newMenu("数据编辑");miFind=newMenuItem("查找数据");miAdd=newMenuItem("添加数据");miEdit=newMenuItem("修改数据");miDel=newMenuItem("删除
6、数据");miShow=newMenuItem("全部显示");myMenuEdit.add(miFind);myMenuEdit.add(miAdd);myMenuEdit.add(miEdit);myMenuEdit.add(miDel);myMenuEdit.add(miShow);myMenuUser=newMenu("用户");miUser=newMenuItem("编辑用户");myMenuUser.add(miUser);myMenuAbout=newMenu("我的作业");miAbout=new
7、MenuItem("作业说明");myMenuAbout.add(miAbout);myMenuBar.add(myMenuFile);myMenuBar.add(myMenuEdit);myMenuBar.add(myMenuUser);myMenuBar.add(myMenuAbout);String[]col={"学号","姓名","性别","民族","年龄","年级","班级","专业"};//创建属性列名mm=newDefaultTableModel(col,0);table.setModel(mm);
8、JScrollPanetableScrollPane=newJScrollPane(table);WORD资料下载可编辑专业技术资料分享this.setMenuBar(myMenuBar);this.add(tableScrollPane);miExit.addActionListener(this);miFind.addActionListener(this);miAd