/** * 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(); }