?? adminwindow.java~8~
字號:
package uml_gaokai;import java.awt.*;import javax.swing.*;import com.borland.jbcl.layout.*;import java.awt.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2003</p> * <p>Company: </p> * @author unascribed * @version 1.0 */public class AdminWindow extends JDialog { private JPanel panel1 = new JPanel(); private XYLayout xYLayout1 = new XYLayout(); private JButton jButton1 = new JButton(); private JButton jButton2 = new JButton(); private JButton jButton3 = new JButton(); private JButton jButton4 = new JButton(); private JButton jButton5 = new JButton(); private JButton jButton6 = new JButton(); public AdminWindow(Frame frame, String title, boolean modal) { super(frame, title, modal); try { jbInit(); pack(); } catch(Exception ex) { ex.printStackTrace(); } } public AdminWindow() { this(null, "", false); } private void jbInit() throws Exception { panel1.setLayout(xYLayout1); jButton1.setText("顧客登錄"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); jButton2.setText("采購員登錄"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton2_actionPerformed(e); } }); jButton3.setText("銷售員登錄"); jButton4.setText("經理登錄"); jButton5.setText("用戶管理"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton5_actionPerformed(e); } }); jButton6.setText("數據管理"); this.getContentPane().add(panel1, BorderLayout.CENTER); panel1.add(jButton1, new XYConstraints(0, 0, -1, 35)); panel1.add(jButton4, new XYConstraints(281, 1, 100, 33)); panel1.add(jButton5, new XYConstraints(375, 2, 92, 32)); panel1.add(jButton6, new XYConstraints(467, 1, 92, 34)); panel1.add(jButton3, new XYConstraints(182, 1, 98, 33)); panel1.add(jButton2, new XYConstraints(84, 1, 100, 33)); }//userManagement 用戶管理()涉及到用戶的增刪改 void jButton5_actionPerformed(ActionEvent e) { UserManagement userManagement = new UserManagement() ; Dimension dlgSize = userManagement.getPreferredSize(); Dimension frmSize = getSize(); Point loc = getLocation(); userManagement.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y); userManagement.setModal(true); userManagement.pack(); userManagement.show(); }//admin作為顧客登錄 void jButton1_actionPerformed(ActionEvent e) { CustomerWindow customerWindow =new CustomerWindow() ; Dimension dlgSize = customerWindow.getPreferredSize(); Dimension frmSize = getSize(); Point loc = getLocation(); customerWindow.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y); customerWindow.setModal(true); customerWindow.pack(); customerWindow.show(); } //admin作為采購員登錄 void jButton2_actionPerformed(ActionEvent e) { BuyerWindow buyerWindow =new BuyerWindow() ; Dimension dlgSize = buyerWindow.getPreferredSize(); Dimension frmSize = getSize(); Point loc = getLocation(); buyerWindow.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y); buyerWindow.setModal(true); buyerWindow.pack(); buyerWindow.show(); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -