1、登录 图1 顾客下单流程图据图删除购物车信息提示错误验证登陆用户id是否正确NY确认结账返回订单生成通过提供食品搜索控件,为顾客提供更为方便快捷的服务。顾客可以快速的找到自己想要下订的美食。3.搜索流程图如图4-3所示:判断txtSearch 是否为空开始键入FoodSearch搜索控件User_SearchReault页dlSearchBind()结束提示输入图2 搜索模块程序流程图数据库查找匹配成功提示未找到4.Java swing做登陆界面:1. 容器类JFrame窗体类JPanel面板类JMenuBar菜单类2. 元素类JTextField文本输入框类JPasswordField密码输
2、入框类JButton按钮类JCheckBox复选框类JComboBox下拉列表JLabel标签类3.布局类使用FlowLayout流式布局类4.Socket API:.Accept方法:产生“阻塞”,直到接受到一个连接,并且返回一个客户端的Socket对象实例。.getinputStream方法:获得网络连接输入.getOutputStream方法:连接的另一端将得到输入,同时返回一个OutputStream对象实例。客户端开发原理:使用Socket对网络上某一个服务器的某一个端口发出连接请求,一旦连接成功,打开对话;会话结束后,关闭Socket。客户端不需要制定打开的端口,通常临时的、动态的
3、分配一个1024以上的端口。5. 主要代码1.主界面: setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle(顾客-网络订餐系统); setBackground(new java.awt.Color(255, 255, 255); nearby.setText(附近小吃 nearby.addMouseListener(new java.awt.event.MouseAdapter() public void mouseClicked(java.awt.event.MouseEvent evt)
4、 nearbyMouseClicked(evt); ); suggest.setText(今日推荐 suggest.addMouseListener(new java.awt.event.MouseAdapter() suggestMouseClicked(evt); myorder.setText(我的订单 myorder.addMouseListener(new java.awt.event.MouseAdapter() myorderMouseClicked(evt); myorder.addActionListener(new java.awt.event.ActionListener
5、() public void actionPerformed(java.awt.event.ActionEvent evt) myorderActionPerformed(evt); all.setText(全部 all.addMouseListener(new java.awt.event.MouseAdapter() allMouseClicked(evt); meat.setText(饭类 meat.addMouseListener(new java.awt.event.MouseAdapter() meatMouseClicked(evt); noodle.setText(面类 noo
6、dle.addMouseListener(new java.awt.event.MouseAdapter() noodleMouseClicked(evt); west.setText(西餐 west.addMouseListener(new java.awt.event.MouseAdapter() westMouseClicked(evt); drink.setText(饮料 drink.addMouseListener(new java.awt.event.MouseAdapter() drinkMouseClicked(evt); other.setText(其他 other.addM
7、ouseListener(new java.awt.event.MouseAdapter() otherMouseClicked(evt); controlcenter.setText(个人中心 controlcenter.addActionListener(new java.awt.event.ActionListener() controlcenterActionPerformed(evt);2.订单信息 jLabel1.setFont(new java.awt.Font(微软雅黑, 0, 24); / NOI18N jLabel1.setText( jLabel2.setText(支付状
8、况: jLabel3.setText(未支付 jButton1.setText(确认收货 jButton1.addActionListener(new java.awt.event.ActionListener() jButton1ActionPerformed(evt); jButton2.setText(取消 jButton2.addActionListener(new java.awt.event.ActionListener() jButton2ActionPerformed(evt); jPanel1.setBorder(javax.swing.BorderFactory.creat
9、eEtchedBorder(); jCheckBox1.setText(COCO咖啡 jCheckBox1.addActionListener(new java.awt.event.ActionListener() jCheckBox1ActionPerformed(evt); jCheckBox2.setText(铁板牛肉 jCheckBox3.setText(木须肉盖浇饭 javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout)
10、; jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckBox1) .addCom
11、ponent(jCheckBox2) .addComponent(jCheckBox3) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) jPanel1Layout.setVerticalGroup( .addComponent(jCheckBox1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jCheckBox2) .addComponent(jCheckBox3) .a
12、ddContainerGap(207, Short.MAX_VALUE) jButton3.setText(删除选中 jLabel4.setText(总价: jTextField1.setEditable(false); jTextField1.setText(48 jTextField1.addActionListener(new java.awt.event.ActionListener() jTextField1ActionPerformed(evt);顾客界面订单生成界面:订单查看界面:文件操作:服务器管理员详细设计1.编写目的编写此文档的目的是为了让管理员更加便捷的管理软件及用户的信
13、息,方便订餐系统的实现。2.系统模块详细设计本系统总共有两大模块,分别是顾客模块,管理员模块。每个模块分别有不同的权限和使用功能。3.登陆模块的流程图 用户名密码 是否合法1-1登陆流程图4.管理员模块详细设计管理员:查看用户订单,查看用户信息,并根据用户信息和用户订单对菜 品进行发派。管理员可以通过订单管理功能来处理日常的订单。管理员订单处理程序流程图:管理员登录绑定数据库信息信息绑定无误更新数据库选择具体订单显示订单订单管理操作图1-2 管理员订单处理程序流程图管理员可以通过此功能模块添加想要添加的各种信息,比如订单处理等功能。Session“AID”是否为空添加输入框是否为空Class
14、ManagerClassAddadmin()验证管理员用户是否已存在添加到数据库提示登录提示重新输入图1-3 管理员添加程序流程图通过提供美食搜索控件,为顾客提供更为方便快捷的服务。搜索流程图如图1-4所示:图1-4 搜索模块程序流程图5.所需要的技术管理员登陆界面Login界面的设计:Java Swing做登陆界面:1.容器类2.元素类3、布局类通信使用Socket API.Accept方法服务器端使用ServerSocket监听指定的端口(大于1024的端口),等待客户连接请求,客户连接后,会产生对话,在完成对话后,关闭连接。客户端服务器之间连接用Socket服务器内存管理(dll)项目名
15、Checkcheck.javalogin.javaindexJFrame.javaindexmanage.javamanage.javaacounting.javacontrolcenter.javamyorder.javaicon.java6. 主要代码: 1.登录界面 jButton2.setText(登录 jButton2.addActionListener(new java.awt.event.ActionListener() public void actionPerformed(java.awt.event.ActionEvent evt) jButton2ActionPerformed(evt); );2.管理界面 jPasswordField1.addActionListener(new java.awt.event.ActionListener() public void actionPerformed(java.awt.event.ActionEvent evt) jPasswordField1ActionPerformed(evt); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);店铺信息
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2