界面 代码

上传人:学*** 文档编号:292023608 上传时间:2022-05-13 格式:DOCX 页数:10 大小:17.54KB
返回 下载 相关 举报
界面 代码_第1页
第1页 / 共10页
界面 代码_第2页
第2页 / 共10页
界面 代码_第3页
第3页 / 共10页
界面 代码_第4页
第4页 / 共10页
界面 代码_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《界面 代码》由会员分享,可在线阅读,更多相关《界面 代码(10页珍藏版)》请在金锄头文库上搜索。

1、本文格式为Word版,下载可任意编辑界面 代码 六、界面,代码 1.权限界面 1数据库联接公共片面 public static Connection conn = null; public static Statement state = null; public static void odbc() String DBDriver = String connectionStr = try Class.forName(DBDriver); catch(java.lang.ClassNotFoundException e)System.err.println( try conn = Driver

2、Manager.getConnection(connectionStr, state = conn.createStatement(); catch(SQLException ex) System.err.println( 2 刷卡选择片面 /= 刷卡界面= if(this.jRadioButton2.isSelected() this.setVisible(false); JOptionPane.showMessageDialog(null,接待进入刷卡界面! Spend.main(null); /= 管理员界面= if(this.jRadioButton1.isSelected() Str

3、ing nstr,pstr,sql; nstr = this.jTextField1.getText(); pstr = this.jTextField2.getText(); sql = ResultSet rs =null; try rs = Main.state.executeQuery(sql); if(rs.next() if(pareTo(rs.getString( this.setVisible(false); JOptionPane.showMessageDialog(null,接待进入管理员界面! Admin.main(null); else JOptionPane.show

4、MessageDialog(null,密码错误 elseJOptionPane.showMessageDialog(null,用户名错误 catch(SQLException ex) System.err.println( /= 学生查询界面= if(this.jRadioButton3.isSelected() this.setVisible(false); JOptionPane.showMessageDialog(null,接待进入学生查询界面! StuInfo.main(null); 2提示界面 3消费界面 1 探寻片面 if(Ids.getText().equals( JOption

5、Pane.showMessageDialog(null,卡号不能为空! Ids.setFocusable(true); else try String sql = * from card_info where id = ResultSet rs = Main.state.executeQuery(sql); if(rs.next() if(rs.getBoolean(3) JOptionPane.showMessageDialog(null,卡已经被锁,如要解锁,请与管理员联系否那么10日后 自动注销! else if(DjCheck.isSelected() Sum.setText(rs.g

6、etString(2); this.result=String.valueOf(Integer.parseInt(Sum.getText()-Integer.parseInt(Dingjia.getText(); JOptionPane.showMessageDialog(null,消费完毕,卡剩余result +。假设要持续消费请在10秒内操作,只后自动关闭帐户 Sum.setText(result); else Ids.setEditable(false); this.jButton26.setEnabled(false); this.jPanel1.setVisible(true); S

7、um.setText(rs.getString(2); jButton12.setEnabled(true); jButton13.setEnabled(true); jButton14.setEnabled(true); jButton15.setEnabled(true); else JOptionPane.showMessageDialog(null,卡号错误! catch(SQLException ex) System.err.println( 2 消费片面 try this.result=String.valueOf(Integer.parseInt(Sum.getText() -

8、Integer.parseInt(Now.getText(); String sql = if(Main.state.executeUpdate(sql)=0) JOptionPane.showMessageDialog(null,消费失败 else this.nows =Now.getText(); this.sums =Sum.getText(); JOptionPane.showMessageDialog(null,消费完毕,卡剩余。假设要持续消费请在10秒内操作,只后自动关闭帐户 Sum.setText(result); catch(SQLException ex) System.er

9、r.println( 3 加减乘片面 if(Jisuan.getText().compareTo( Jisuan.setText(Now.getText(); Now.setText( else switch(ops) case 3: int a= 0; a=Integer.parseInt(Jisuan.getText() * Integer.parseInt(Now.getText(); if(a999) JOptionPane.showMessageDialog(null,计算量超过消费最大值! else Jisuan.setText(String.valueOf(Integer.parseInt(Jisuan.getText() Integer.parseInt(Now.getText(); Now.setText(Jisuan.getText(); break; case 2: int b=0;

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号