public void mousePressed(MouseEvent e) { if (popupMenu.isShowing() && isDropDownEnabled) { popupMenu.setVisible(false); } else if (isDropDownEnabled) { popupMenu.showMenu ((Component) e.getSource(), DropDownComponent.this); } } public void mouseEntered(MouseEvent ev) {
public void mousePressed(MouseEvent e) { if (popupMenu.isShowing() && isDropDownEnabled) { popupMenu.setVisible(false); } else if (isDropDownEnabled) { popupMenu.showMenu ((Component) e.getSource(), DropDownComponent.this); } } public void mouseEntered(MouseEvent ev) {
/** * Shows this popup menu. * * @param invoker * The popup menu invoker component * @param refComponent * The dropdown component that containts this menu */ public void showMenu(Component invoker, Component refComponent) { model.processBeforeShowed(); Point abs = new Point(0, refComponent.getHeight()); SwingUtilities.convertPointToScreen(abs, refComponent); this.setLocation(abs); this.setInvoker(invoker); this.setVisible(true); this.revalidate(); this.repaint(); model.processAfterShowed(); }
/** * Shows this popup menu. * * @param invoker * The popup menu invoker component * @param refComponent * The dropdown component that containts this menu */ public void showMenu(Component invoker, Component refComponent) { model.processBeforeShowed(); Point abs = new Point(0, refComponent.getHeight()); SwingUtilities.convertPointToScreen(abs, refComponent); this.setLocation(abs); this.setInvoker(invoker); this.setVisible(true); this.revalidate(); this.repaint(); model.processAfterShowed(); }
/** * Processes click on the pop up menu item. */ public void processItemClicked() { footer.setText(model.getFooterText() + 0); setVisible(false); model.processItemClicked(); }
/** * Processes click on the pop up menu item. */ public void processItemClicked() { footer.setText(model.getFooterText() + 0); setVisible(false); model.processItemClicked(); }