MenuBarEvent.java
上传用户:whbcdz
上传日期:2008-08-04
资源大小:7683k
文件大小:6k
源码类别:

JavaScript

开发平台:

Java

  1. package appjxc.constrol;
  2. import java.awt.event.ActionEvent;
  3. import java.awt.event.ActionListener;
  4. //import appgdzc.view.*;
  5. import java.awt.Dimension;
  6. import java.awt.Toolkit;
  7. import javax.swing.DefaultDesktopManager;
  8. import javax.swing.JOptionPane;
  9. import appjxc.view.*;
  10. public class MenuBarEvent implements ActionListener{
  11.     private javax.swing.JDesktopPane JDeskTop = null;
  12.     private String EventName = "";
  13.     private DefaultDesktopManager desktopManager = new DefaultDesktopManager();
  14.     public void setDeskTop(javax.swing.JDesktopPane deskTop){
  15.         this.JDeskTop = deskTop;
  16.        // JDeskTop.setDesktopManager(desktopManager);
  17.     }
  18.     public void setEventName(String eventName){
  19.         this.EventName = eventName;
  20.     }
  21.     public void actionPerformed(ActionEvent e) {
  22.         System.out.println("e.getActionCommand() = " + e.getActionCommand() + ";EventName = " + EventName);
  23.         if(e.getActionCommand().equals("JB_EXIT") || EventName.equals("JB_EXIT")){
  24.             javax.swing.DefaultDesktopManager manger = new DefaultDesktopManager();
  25.             int result = JOptionPane.showOptionDialog(null,"是否真的退出医药进销存管理系统?","系统提示",
  26.                                    JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,
  27.                                    null,new String[]  {"是","否"},"否");
  28.             if (result == JOptionPane.YES_OPTION) {
  29.                 System.exit(0);
  30.             }
  31.             EventName = "";
  32.         }
  33.        if(e.getActionCommand().equals("JF_view_medicine")||EventName.equals("JF_view_medicine")){
  34.             JF_view_medicine jfInternalFrame = new JF_view_medicine();
  35.             jfInternalFrame.setLocation(50,50);
  36.             JDeskTop.add(jfInternalFrame);
  37.             EventName = "";
  38.             return;
  39.         }
  40.         if(e.getActionCommand().equals("JF_view_client")||EventName.equals("JF_view_client")){
  41.             JF_view_client jfInternalFrame = new JF_view_client();
  42.             jfInternalFrame.setLocation(80,80);
  43.             JDeskTop.add(jfInternalFrame);
  44.             EventName = "";
  45.             return;
  46.         }
  47.         if(e.getActionCommand().equals("JF_view_gys")||EventName.equals("JF_view_gys")){
  48.             JF_view_gys jfInternalFrame = new JF_view_gys();
  49.             jfInternalFrame.setLocation(80,80);
  50.             JDeskTop.add(jfInternalFrame);
  51.             EventName = "";
  52.             return;
  53.         }
  54.         if(e.getActionCommand().equals("JF_view_sell")||EventName.equals("JF_view_sell")){
  55.             JF_view_sell jfInternalFrame = new JF_view_sell();
  56.             jfInternalFrame.setLocation(20,20);
  57.             JDeskTop.add(jfInternalFrame);
  58.             EventName = "";
  59.             return;
  60.         }
  61.         if(e.getActionCommand().equals("JF_view_buy")||EventName.equals("JF_view_buy")){
  62.             JF_view_buy jfInternalFrame = new JF_view_buy();
  63.             jfInternalFrame.setLocation(20,20);
  64.             JDeskTop.add(jfInternalFrame);
  65.             EventName = "";
  66.             return;
  67.         }
  68.         if(e.getActionCommand().equals("JF_view_stock")||EventName.equals("JF_view_stock")){
  69.            JF_view_kcpd jfInternalFrame = new JF_view_kcpd();
  70.            jfInternalFrame.setLocation(80,20);
  71.            JDeskTop.add(jfInternalFrame);
  72.            EventName = "";
  73.            return;
  74.        }
  75.        if(e.getActionCommand().equals("JF_view_xstk")||EventName.equals("JF_view_xstk")){
  76.           JF_view_xstk jfInternalFrame = new JF_view_xstk();
  77.           jfInternalFrame.setLocation(80,20);
  78.           JDeskTop.add(jfInternalFrame);
  79.           EventName = "";
  80.           return;
  81.        }
  82.        if(e.getActionCommand().equals("JF_view_hkgl")||EventName.equals("JF_view_hkgl")){
  83.           JF_view_hkgl jfInternalFrame = new JF_view_hkgl();
  84.           jfInternalFrame.setLocation(20,20);
  85.           jfInternalFrame.setTitle("医药进销存管理系统--[客户回款]");
  86.           JDeskTop.add(jfInternalFrame);
  87.           EventName = "";
  88.           return;
  89.        }
  90.        if(e.getActionCommand().equals("JF_view_query_jbqk")||EventName.equals("JF_view_query_jbqk")){
  91.           JF_view_query_jbqk jfInternalFrame = new JF_view_query_jbqk();
  92.           jfInternalFrame.setLocation(20,20);
  93.           jfInternalFrame.setTitle("医药进销存管理系统--[基本信息查询]");
  94.           JDeskTop.add(jfInternalFrame);
  95.           EventName = "";
  96.           return;
  97.        }
  98.        if(e.getActionCommand().equals("JF_view_query_rkqk")||EventName.equals("JF_view_query_rkqk")){
  99.           JF_view_query_kcmx_rk jfInternalFrame = new JF_view_query_kcmx_rk();
  100.           jfInternalFrame.setLocation(80,20);
  101.           jfInternalFrame.setTitle("医药进销存管理系统--[入库明细表查询]");
  102.           JDeskTop.add(jfInternalFrame);
  103.           EventName = "";
  104.           return;
  105.        }
  106.          if(e.getActionCommand().equals("JF_view_query_kcmx_ck")||EventName.equals("JF_view_query_kcmx_ck")){
  107.             JF_view_query_kcmx_ck jfInternalFrame = new JF_view_query_kcmx_ck();
  108.             jfInternalFrame.setLocation(80,20);
  109.             jfInternalFrame.setTitle("医药进销存管理系统--[销售明细表查询]");
  110.             JDeskTop.add(jfInternalFrame);
  111.             EventName = "";
  112.             return;
  113.          }
  114.          if(e.getActionCommand().equals("JF_view_query_kcmx_hk")||EventName.equals("JF_view_query_kcmx_hk")){
  115.             JF_view_query_kcmx_hk jfInternalFrame = new JF_view_query_kcmx_hk();
  116.             jfInternalFrame.setLocation(80,20);
  117.             jfInternalFrame.setTitle("医药进销存管理系统--[客户回款情况查询]");
  118.             JDeskTop.add(jfInternalFrame);
  119.             EventName = "";
  120.             return;
  121.          }
  122.          if(e.getActionCommand().equals("sys_user_add")||EventName.equals("sys_user_add")){
  123.            JF_user_add jfzcxxzcwx = new JF_user_add();
  124.            jfzcxxzcwx.setLocation(150,150);
  125.            JDeskTop.add(jfzcxxzcwx);
  126.            EventName = "";
  127.            return;
  128.        }
  129.         if(e.getActionCommand().equals("sys_user_modify")||EventName.equals("sys_user_modify")){
  130.            JF_user_modi jfzcxxzcwx = new JF_user_modi();
  131.            jfzcxxzcwx.setLocation(150,150);
  132.            JDeskTop.add(jfzcxxzcwx);
  133.            EventName = "";
  134.            return;
  135.        }
  136. /*       if(EventName.equals("JB_LOGIN")){
  137.            JF_Login_try jfzcxxzcwx = new JF_Login_try();
  138.            jfzcxxzcwx.setLocation(150,150);
  139.            JDeskTop.add(jfzcxxzcwx);
  140.            return;
  141.        }*/
  142.     }
  143. }