Пример #1
0
  private void init() {
    CPanel panel = new CPanel();
    panel.setLayout(new MigLayout());
    getContentPane().add(panel);

    panel.add(new CLabel(Msg.translate(posPanel.getCtx(), "SalesRep_ID")));

    username =
        new PosTextField(
            Msg.translate(posPanel.getCtx(), "SalesRep_ID"),
            posPanel,
            posPanel.p_pos.getOSK_KeyLayout_ID());

    panel.add(username, "wrap");

    panel.add(new CLabel(Msg.translate(posPanel.getCtx(), "UserPIN")));

    pin =
        new PosTextField(
            Msg.translate(posPanel.getCtx(), "UserPIN"),
            posPanel,
            posPanel.p_pos.getOSNP_KeyLayout_ID());

    panel.add(pin, "");

    AppsAction act = new AppsAction("Ok", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), false);
    act.setDelegate(this);
    bProcess = (CButton) act.getButton();
    bProcess.setFocusable(false);
    panel.add(bProcess, "h 50!, w 50!");

    pack();
  }
Пример #2
0
 /**
  * Create Action Button
  *
  * @param action action
  * @return button
  */
 protected CButton createButtonAction(String action, KeyStroke accelerator) {
   AppsAction act = new AppsAction(action, accelerator, false);
   act.setDelegate(this);
   CButton button = (CButton) act.getButton();
   button.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
   button.setMinimumSize(getPreferredSize());
   button.setMaximumSize(getPreferredSize());
   button.setFocusable(false);
   return button;
 } //	getButtonAction