您好,欢迎光临本网站![请登录][注册会员]  
文件名称: 小超市管理系统
  所属分类: Java
  开发工具:
  文件大小: 704kb
  下载次数: 0
  上传时间: 2013-06-18
  提 供 者: u0111*****
 详细说明: java的小超市管理系统 public class Login extends Frame implements ActionListener,WindowListener //登陆界面 { public int screanWidth,screanHeight; String idin=null; String keyin=null; String passwordD=null; public static String persontyD=null; MenuBar menubar; Menu menu; MenuItem quet,help; Label id,key; TextField idtf,keytf; Box boxV1,boxV2,boxV3,baseBox,boxx; Button enterB; Login() { setTitle("超市管理系统登陆界面"); Toolkit tool=getToolkit(); Dimension dim=tool.getScreenSize(); screanWidth=dim.width ; screanHeight=dim.height; setBounds(dim.width/3,dim.height/3,320,215); menubar=new MenuBar(); menu=new Menu("功能"); help=new MenuItem("帮助"); quet=new MenuItem("退出"); quet.setShortcut(new MenuShortcut(KeyEvent.VK_E)); quet.addActionListener(new ActionListener() //匿名类实例控制 { public void actionPerformed(ActionEvent p){ System.exit(0); }} ); menu.add(help); menu.add(quet); menubar.add(menu); setMenuBar(menubar); id=new Label("请输入帐号:",Label.RIGHT); key=new Label("请输入密码:",Label.RIGHT); idtf=new TextField(10); keytf=new TextField(10); keytf.setEchoChar('*'); enterB=new Button("登陆"); boxV1=Box.createVerticalBox(); boxV1.add(Box.createVerticalStrut(35)); boxV1.add(id); boxV1.add(Box.createVerticalStrut(15)); boxV1.add(key); boxV1.add(Box.createVerticalStrut(15)); boxV2=Box.createVerticalBox(); boxV2.add(Box.createVerticalStrut(35)); boxV2.add(idtf); boxV2.add(Box.createVerticalStrut(15)); boxV2.add(keytf); boxV2.add(Box.createVerticalStrut(15)); baseBox=Box.createHorizontalBox(); baseBox.add(Box.createHorizontalStrut(25)); baseBox.add(boxV1); baseBox.add(Box.createHorizontalStrut(5)); baseBox.add(boxV2); baseBox.add(Box.createHorizontalStrut(70)); boxV3=Box.createHorizontalBox(); boxV3.add(Box.createHorizontalStrut(125)); boxV3.add(enterB); boxV3.add(Box.createHorizontalStrut(125)); boxx=Box.createVerticalBox(); boxx.add(baseBox); boxx.add(Box.createVerticalStrut(15)); boxx.add(boxV3); boxx.add(Box.createVerticalStrut(70)); add(boxx); enterB.addActionListener(this); addWindowListener(this); setResizable(false); setVisible(true); } public void actionPerformed(ActionEvent e) { Connection con; Statement sql; ResultSet rs; if (e.getSource()==enterB) { idin=idtf.getText(); keyin=keytf.getText(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch (ClassNotFoundException f) {System.out.println(""+f);} try {con=DriverManager.getConnection("jdbc:odbc:q","",""); sql=con.createStatement(); rs=sql.executeQuery("SELECT * FROM password where ID='"+idin+"'"); while(rs.next()){ passwordD=rs.getString(2); persontyD=rs.getString(3);} con.close();} catch (SQLException g) {System.out.println(g);} if (keyin.equals(passwordD)) {View2 frame=new View2(); this.setVisible(false); } else {JOptionPane.showMessageDialog(this," 帐户或密码错误\n 请重新输入","提示",JOptionPane.WARNING_MESSAGE); } } } public void windowActivated(WindowEvent o) {validate();} public void windowDeactivated(WindowEvent o) {setBounds(screanWidth/3,screanHeight/3,320,215); validate();} public void windowClosing(WindowEvent o) {dispose();} public void windowClosed(WindowEvent o) {System.exit(0);} public void windowIconified(WindowEvent o) {} public void windowDeiconified(WindowEvent o) {setBounds(screanWidth/3,screanHeight/3,320,215); validate();} public void windowOpened(WindowEvent o){} } ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: java
 输入关键字,在本站1000多万海量源码库中尽情搜索: