AdminWindow.java~3~
上传用户:liming9091
上传日期:2014-10-27
资源大小:3376k
文件大小:2k
源码类别:

Java编程

开发平台:

Java

  1. package uml_gaokai;
  2. import java.awt.*;
  3. import javax.swing.*;
  4. import com.borland.jbcl.layout.*;
  5. import java.awt.event.*;
  6. /**
  7.  * <p>Title: </p>
  8.  * <p>Description: </p>
  9.  * <p>Copyright: Copyright (c) 2003</p>
  10.  * <p>Company: </p>
  11.  * @author unascribed
  12.  * @version 1.0
  13.  */
  14. public class AdminWindow extends JDialog {
  15.   private JPanel panel1 = new JPanel();
  16.   private XYLayout xYLayout1 = new XYLayout();
  17.   private JButton jButton1 = new JButton();
  18.   private JButton jButton2 = new JButton();
  19.   private JButton jButton3 = new JButton();
  20.   private JButton jButton4 = new JButton();
  21.   private JButton jButton5 = new JButton();
  22.   private JButton jButton6 = new JButton();
  23.   public AdminWindow(Frame frame, String title, boolean modal) {
  24.     super(frame, title, modal);
  25.     try {
  26.       jbInit();
  27.       pack();
  28.     }
  29.     catch(Exception ex) {
  30.       ex.printStackTrace();
  31.     }
  32.   }
  33.   public AdminWindow() {
  34.     this(null, "", false);
  35.   }
  36.   private void jbInit() throws Exception {
  37.     panel1.setLayout(xYLayout1);
  38.     jButton1.setText("顾客登录");
  39.     jButton2.setText("采购员登录");
  40.     jButton3.setText("销售员登录");
  41.     jButton4.setText("经理登录");
  42.     jButton5.setText("用户管理");
  43.     jButton5.addActionListener(new java.awt.event.ActionListener() {
  44.       public void actionPerformed(ActionEvent e) {
  45.         jButton5_actionPerformed(e);
  46.       }
  47.     });
  48.     jButton6.setText("数据管理");
  49.     this.getContentPane().add(panel1, BorderLayout.CENTER);
  50.     panel1.add(jButton1, new XYConstraints(0, 0, -1, 33));
  51.     panel1.add(jButton2, new XYConstraints(83, 1, 100, 32));
  52.     panel1.add(jButton3,  new XYConstraints(183, 0, 98, 33));
  53.     panel1.add(jButton4,    new XYConstraints(281, 1, 100, 33));
  54.     panel1.add(jButton5,    new XYConstraints(375, 2, 92, 32));
  55.     panel1.add(jButton6,  new XYConstraints(467, 1, 92, 34));
  56.   }
  57.   void jButton5_actionPerformed(ActionEvent e) {
  58.     UserManagement userManagement = new UserManagement() ;
  59.     Dimension dlgSize = userManagement.getPreferredSize();
  60.     Dimension frmSize = getSize();
  61.     Point loc = getLocation();
  62.     userManagement.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
  63.     userManagement.setModal(true);
  64.     userManagement.pack();
  65.     userManagement.show();
  66.   }
  67. }