/**
   * 构造函数
   *
   * @param panel 主面板
   * @param frame 主窗口
   */
  public AddExceptionLineItemDialog(AddExceptionLineItem panel, JFrame frame) {
    super(frame, true);
    this.frame = frame;
    ((JComponent) this.getContentPane()).setOpaque(true);
    this.panel = panel;
    this.commodityController = ControllerFactoryImpl.getInstance().getCommodityController();
    this.vomap = new HashMap<String, CommodityVO>();
    this.cfg = ERPConfig.getADDEXCEPTIONLINEITEM_DIALOG_CONFIG();

    // 设置大小、坐标、布局
    this.setTitle(cfg.getTitle());
    this.setBounds(cfg.getX(), cfg.getY(), cfg.getW(), cfg.getH());
    this.setLayout(null);
    this.setResizable(false);
    this.setLocation(frame.getX() + this.cfg.getX(), frame.getY() + this.cfg.getY());

    //  初始化组件
    this.initComponent();
    this.setVisible(true);
  }
Пример #2
0
 public LoginPanel(LoginUI frame) {
   this.loginController = ControllerFactoryImpl.getInstance().getLoginController();
   // 获得面板配置
   this.pcfg = ERPConfig.getLOGINFRAME_CONFIG().getConfigMap().get(this.getClass().getName());
   this.frame = frame;
   // 设置布局管理器为自由布局
   this.setLayout(null);
   this.setSize(pcfg.getW(), pcfg.getH());
   this.setLocation(pcfg.getX(), pcfg.getY());
   this.bg = pcfg.getBg();
   // 初始化组件
   this.initComponent();
   this.addKeyListener(
       new KeyAdapter() {
         @Override
         public void keyReleased(KeyEvent e) {
           if (e.getKeyCode() == KeyEvent.VK_ENTER) {
             if (e.getSource() == loginBtn) checkLogin();
             if (e.getSource() == quitBtn) checkQuit();
           }
         }
       });
   this.repaint();
 }