首页 java点菜系统代码

java点菜系统代码

举报
开通vip

java点菜系统代码java点菜系统代码java点菜系统代码PAGEjava点菜系统代码酒店点菜系统import.*;import.*;import.*;importclassJiudianimplementsActionListener,ItemListener{staticJFramef=null;etDefaultButton(button1);//设置窗体回车对应按钮();//排版(250,250,400,400);(newWindowAdapter(){publicvoidwindowClosing(WindowEve...

java点菜系统代码
java点菜系统代码java点菜系统代码PAGEjava点菜系统代码酒店点菜系统import.*;import.*;import.*;importclassJiudianimplementsActionListener,ItemListener{staticJFramef=null;etDefaultButton(button1);//设置窗体回车对应按钮();//排版(250,250,400,400);(newWindowAdapter(){publicvoidwindowClosing(WindowEventevt){(0);}});}publicvoiditemStateChanged(ItemEvente)//单选钮被点击时触发{if()==r1)op=1;if()==r2)op=2;if()==r3)op=3;if()==r4)op=4;if()==r5)op=5;if()==c1)i=1;if()==c2)i=2;if()==c3)i=3;if()==c4)i=4;}publicvoidactionPerformed(ActionEvente)//单选按钮被点击时触发{Stringcmd=();if("确定")){try{("");Connectioncon=("jdbc:odbc:jiudian","test","1234");Statementstmt=();intm=0,val=0;Stringstr=null;StringSQLOrder;switch(op){case1:{switch(i){case1:m=1;val=25;str="小鸡炖蘑菇";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case2:m=1;val=18;str="青椒炒肉";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case3:m=1;val=36;str="东北火锅";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case4:m=1;val=36;str="豆腐炖鱼头";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);}break;}case2:switch(i){case1:m=2;val=25;str="小鸡炖蘑菇";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case2:m=2;val=18;str="青椒炒肉";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case3:m=2;val=36;str="东北火锅";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case4:m=2;val=36;str="豆腐炖鱼头";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);}case3:switch(i){case1:m=3;val=25;str="小鸡炖蘑菇";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case2:m=3;val=18;str="青椒炒肉";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case3:m=3;val=36;str="东北火锅";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case4:m=3;val=36;str="豆腐炖鱼头";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);}break;case4:switch(i){case1:m=4;val=25;str="小鸡炖蘑菇";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case2:m=4;val=18;str="青椒炒肉";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case3:m=4;val=36;str="东北火锅";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case4:m=4;val=36;str="豆腐炖鱼头";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);}break;case5:switch(i){case1:m=5;val=25;str="小鸡炖蘑菇";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case2:m=5;val=18;str="青椒炒肉";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case3:m=5;val=36;str="东北火锅";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);case4:m=5;val=36;str="豆腐炖鱼头";SQLOrder="InsertIntojiudianValues("+m+",'"+str+"',"+val+")";(SQLOrder);}break;}}catch(Exceptionem){}}if("结帐")){newjiezhang(f);}}publicstaticvoidmain(Stringargs[])throwsException{newJiudian();newjiudian1(f);}}classjiudian1implementsActionListener{JFramef;//类属性JDialogDialog;publicjiudian1(JFramef)//构造方法{Dialog=newJDialog();//新建一对话框("酒店管理系统");//设置标题//f=newJFrame("酒店管理系统");//创建一个顶层容器ContainercontentPane=();//获得其内容面板JPanelbuttonPanel=newJPanel();//创建一中间容器JPanelJButtonb=newJButton("进入系统");//创建一原子组件——按钮(this);//为按钮添加事件监听器对象(b);//将此按钮添加到中间容器b=newJButton("退出系统");//再创建一按钮(this);//为按钮增加事件监听器(b);//将按钮添加到中间容器(,2),"欢迎光临",,);(buttonPanel,;//将中间容器添加到内容面板(250,250,200,200);(true);=f;}publicvoidactionPerformed(ActionEvente){Stringcmd=();if("进入系统")){();(true);}//显示主窗体if("退出系统"))(0);}}/////////////////////////classjiezhangimplementsActionListener{JDialogDialog;JLabelL1,L2,L3,L4,L5;JTextFieldF1=newJTextField();jiezhang(JFramef){Dialog=newJDialog(f,"结账",true);ContainerdialogPane=();(newGridLayout(4,2));L1=newJLabel("请输入您的桌号",;L2=newJLabel("您总共消费了:",;L4=newJLabel("您总共点了:",;L3=newJLabel("",;L5=newJLabel("",;(L1);(F1);(L2);(L3);(L4);(L5);JButtonb1=newJButton("确定");(b1);JButtonb2=newJButton("取消");(b2);(this);(this);(400,400,300,300);();}publicvoidactionPerformed(ActionEvente){Stringcmd=();if("确定")){try{("");Connectioncon=("jdbc:odbc:jiudian","test","1234");Statementstmt=();intsa=());ResultSetrs=("selectsum(values)fromjiudianwhereid="+sa+"");while()){(""+(1)+"元");}ResultSetrr=("select*fromjiudian");intj=0;while())j=j+1;(""+j+"份菜");("deletefromjiudianwhereid="+sa+"");(Dialog,"谢谢惠顾!","",;("");();();}catch(Exceptionem){}}if("取消")){();}}}
本文档为【java点菜系统代码】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
个人认证用户
香香公主
性格开朗,工作认真,善于沟通,被学校评为学习标兵。
格式:doc
大小:28KB
软件:Word
页数:4
分类:企业经营
上传时间:2021-11-19
浏览量:3