Пример #1
0
  private void btnAddActionPerformed(ActionEvent e) {
    final JidePopup popup = new JidePopup();

    DlgACME dlg =
        new DlgACME(
            new Closure() {
              @Override
              public void execute(Object o) {
                if (o != null) {
                  cmbAcme.setModel(new DefaultComboBoxModel(new ACME[] {(ACME) o}));
                  cmbAcme.setSelectedIndex(0);
                  popup.hidePopup();
                }
              }
            });

    popup.setMovable(false);
    popup.setResizable(false);
    popup.getContentPane().setLayout(new BoxLayout(popup.getContentPane(), BoxLayout.LINE_AXIS));
    popup.getContentPane().add(dlg);
    popup.setOwner(btnAdd);
    popup.removeExcludedComponent(btnAdd);
    popup.setTransient(true);
    popup.setDefaultFocusComponent(dlg);

    popup.showPopup(new Insets(-5, 0, -5, 0), btnAdd);
  }
Пример #2
0
 private void showPopup(MouseEvent evt, JComponent component) {
   hidePopup();
   popup = new JidePopup();
   popup.setOwner(this);
   popup.setDefaultFocusComponent(component);
   popup.getContentPane().add(component);
   popup.setAttachable(true);
   popup.setMovable(false);
   popup.showPopup(evt.getXOnScreen(), evt.getYOnScreen());
 }