Java Code Examples for javax.swing.Popup

The following examples show how to use javax.swing.Popup. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: FlatLaf   Source File: FlatPopupFactory.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Popup getPopup( Component owner, Component contents, int x, int y )
	throws IllegalArgumentException
{
	if( !isDropShadowPainted( owner, contents ) )
		return new NonFlashingPopup( super.getPopup( owner, contents, x, y ), contents );

	// macOS and Linux adds drop shadow to heavy weight popups
	if( SystemInfo.IS_MAC || SystemInfo.IS_LINUX ) {
		Popup popup = getHeavyWeightPopup( owner, contents, x, y );
		if( popup == null )
			popup = super.getPopup( owner, contents, x, y );
		return new NonFlashingPopup( popup, contents );
	}

	// create drop shadow popup
	return new DropShadowPopup( super.getPopup( owner, contents, x, y ), owner, contents );
}
 
Example 2
Source Project: FlatLaf   Source File: FlatPopupFactory.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * There is no API in Java 8 to force creation of heavy weight popups,
 * but it is possible with reflection. Java 9 provides a new method.
 *
 * When changing FlatLaf system requirements to Java 9+,
 * then this method can be replaced with:
 *    return getPopup( owner, contents, x, y, true );
 */
private Popup getHeavyWeightPopup( Component owner, Component contents, int x, int y )
	throws IllegalArgumentException
{
	try {
		if( SystemInfo.IS_JAVA_9_OR_LATER ) {
			if( java9getPopupMethod == null ) {
				java9getPopupMethod = PopupFactory.class.getDeclaredMethod(
					"getPopup", Component.class, Component.class, int.class, int.class, boolean.class );
			}
			return (Popup) java9getPopupMethod.invoke( this, owner, contents, x, y, true );
		} else {
			// Java 8
			if( java8getPopupMethod == null ) {
				java8getPopupMethod = PopupFactory.class.getDeclaredMethod(
					"getPopup", Component.class, Component.class, int.class, int.class, int.class );
				java8getPopupMethod.setAccessible( true );
			}
			return (Popup) java8getPopupMethod.invoke( this, owner, contents, x, y, /*HEAVY_WEIGHT_POPUP*/ 2 );
		}
	} catch( NoSuchMethodException | SecurityException | IllegalAccessException | InvocationTargetException ex ) {
		// ignore
		return null;
	}
}
 
Example 3
Source Project: netbeans   Source File: CustomPopupFactory.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Popup getPopup(Component owner, Component contents,
                      int x, int y) throws IllegalArgumentException {
    assert owner instanceof JComponent;
    Dimension d = contents.getPreferredSize();
    Container c = ((JComponent) owner).getTopLevelAncestor();
    if (c == null) {
        throw new IllegalArgumentException ("Not onscreen: " + owner);
    }
    Point p = new Point (x, y);
    SwingUtilities.convertPointFromScreen(p, c);
    Rectangle r = new Rectangle (p.x, p.y, d.width, d.height);
    if (c.getBounds().contains(r)) {
        //XXX need API to determine if editor area comp is heavyweight,
        //and if so, return a "medium weight" popup of a java.awt.Component
        //that embeds the passed contents component
        return new LWPopup (owner, contents, x, y);
    } else {
        return new HWPopup (owner, contents, x, y);
    }
}
 
Example 4
Source Project: Logisim   Source File: LayoutPopupManager.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void showPopup(Set<AppearancePort> portObjects) {
	dragStart = null;
	CircuitState circuitState = canvas.getCircuitState();
	if (circuitState == null)
		return;
	ArrayList<Instance> ports = new ArrayList<Instance>(portObjects.size());
	for (AppearancePort portObject : portObjects) {
		ports.add(portObject.getPin());
	}

	hideCurrentPopup();
	LayoutThumbnail layout = new LayoutThumbnail();
	layout.setCircuit(circuitState, ports);
	JViewport owner = canvasPane.getViewport();
	Point ownerLoc = owner.getLocationOnScreen();
	Dimension ownerDim = owner.getSize();
	Dimension layoutDim = layout.getPreferredSize();
	int x = ownerLoc.x + Math.max(0, ownerDim.width - layoutDim.width - 5);
	int y = ownerLoc.y + Math.max(0, ownerDim.height - layoutDim.height - 5);
	PopupFactory factory = PopupFactory.getSharedInstance();
	Popup popup = factory.getPopup(canvasPane.getViewport(), layout, x, y);
	popup.show();
	curPopup = popup;
	curPopupTime = System.currentTimeMillis();
}
 
Example 5
private void initPopup(Component owner, Component contents, int x, int y, Popup popup) {
	this.owner = owner;
	this.contents = contents;
	this.popup = popup;
	this.x = x;
	this.y = y;

	boolean mac = false;
	try {
		mac = System.getProperty("os.name").toLowerCase().startsWith("mac");
	} catch (SecurityException e) {
		// do nothing
	}
	if (mac) {
		((JComponent) contents).setBorder(Borders.getPopupMenuBorder());
	} else if (((JComponent) contents).getBorder() instanceof DummyBorder) {
		if ((owner != null) //
				&& (((owner instanceof JMenu) && ((JMenu) owner).isTopLevelMenu()) //
				|| ((owner.getParent() != null) && (owner.getParent() instanceof javax.swing.JToolBar)) //
				|| (owner instanceof javax.swing.JComboBox))) {
			((JComponent) contents).setBorder(Borders.getPopupBorder());
		} else {
			((JComponent) contents).setBorder(Borders.getShadowedPopupMenuBorder());
		}
	}
}
 
Example 6
/**
 * Checks if the focus is still on this component or its child components.
 */
private boolean isFocusInside(Object newFocusedComp) {
	if (newFocusedComp instanceof Popup) {
		return true;
	}
	if (newFocusedComp instanceof Component && !SwingUtilities.isDescendingFrom((Component) newFocusedComp, this)) {
		// Check if focus is on other window
		if (containingWindow == null) {
			return false;
		}

		Window focusedWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();

		// if focus is on other window in owner chain, return false
		Window parent = containingWindow;
		do {
			if (parent == focusedWindow) {
				return false;
			} else {
				parent = parent.getOwner();
			}
		} while (parent != null);
	}
	return true;
}
 
Example 7
public static void setPopupFactory() {
	PopupFactory.setSharedInstance(new PopupFactory() {

		@Override
		public Popup getPopup(Component owner, Component contents, int x, int y) throws IllegalArgumentException {
			if (contents instanceof JToolTip) {
				JToolTip toolTip = (JToolTip)contents;
				int width = (int) toolTip.getPreferredSize().getWidth();
				
				GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
				int screenWidth = gd.getDisplayMode().getWidth();
				
				// if there is enough room, move tooltip to the right to have enough room
				// for large tooltips.
				// this way they don't hinder mouse movement and make it possible to easily
				// view multiple tooltips of items.
				if (x + width + TOOLTIP_X_OFFSET < screenWidth) {
					x += TOOLTIP_X_OFFSET;
				}
			}
			return super.getPopup(owner, contents, x, y);
		}
	});
}
 
Example 8
Source Project: javamelody   Source File: ShadowPopupFactory.java    License: Apache License 2.0 6 votes vote down vote up
static Popup getInstance(Component owner, Component contents, int x, int y,
		Popup delegate) {
	final ShadowPopup result;
	synchronized (ShadowPopup.class) {
		if (cache == null) {
			cache = new ArrayList<>(MAX_CACHE_SIZE);
		}
		if (!cache.isEmpty()) {
			result = cache.remove(0);
		} else {
			result = new ShadowPopup();
		}
	}
	result.reset(owner, contents, x, y, delegate);
	return result;
}
 
Example 9
Source Project: jdk1.8-source-analysis   Source File: MultiPopupMenuUI.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
Example 10
Source Project: FlatLaf   Source File: FlatPopupFactory.java    License: Apache License 2.0 5 votes vote down vote up
NonFlashingPopup( Popup delegate, Component contents ) {
	this.delegate = delegate;

	popupWindow = SwingUtilities.windowForComponent( contents );
	if( popupWindow != null ) {
		// heavy weight popup

		// fix background flashing which may occur on some platforms
		// (e.g. macOS and Linux) when using dark theme
		oldPopupWindowBackground = popupWindow.getBackground();
		popupWindow.setBackground( contents.getBackground() );
	}
}
 
Example 11
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
Example 12
Source Project: arcusplatform   Source File: Toast.java    License: Apache License 2.0 5 votes vote down vote up
public Toast(Component comp, Point toastLocation, String msg, long forDuration) {
    this.component = comp;
    this.location = toastLocation;
    this.message = msg;
    this.duration = forDuration;

    if(this.component != null)
    {

        if(this.location == null)
        {
            this.location = component.getLocationOnScreen();
        }

        new Thread(new Runnable()
        {
            @Override
            public void run()
            {
                Popup view = null;
                try
                {
                    Label tip = new Label(message);
                    tip.setForeground(Color.black);
                    tip.setBackground(Color.white);
                    view = PopupFactory.getSharedInstance().getPopup(component, tip , location.x + 30, location.y + component.getHeight() + 5);
                    view.show();
                    Thread.sleep(duration);
                } catch (InterruptedException ex)
                {
                    Logger.getLogger(Toast.class.getName()).log(Level.SEVERE, null, ex);
                }
                finally
                {
                    view.hide();
                }
            }
        }).start();
    }
}
 
Example 13
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
Example 14
Source Project: jdk8u60   Source File: MultiPopupMenuUI.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
Example 15
Source Project: JDKSourceCode1.8   Source File: MultiPopupMenuUI.java    License: MIT License 5 votes vote down vote up
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
Example 16
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
Example 17
Source Project: netbeans   Source File: VisualDesignerPopupMenuUI.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Popup getPopup(JPopupMenu popup, int x, int y) {
    PopupFactory popupFactory = layer.hackedPopupFactory;
    if(popupFactory == null) {
        return super.getPopup(popup, x, y);
    }
    return popupFactory.getPopup(popup.getInvoker(), popup, x, y);
}
 
Example 18
Source Project: netbeans   Source File: VisualDesignerPopupFactory.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Popup getPopup(Component owner, Component contents, int x, int y) throws IllegalArgumentException {
    final JMenu menu = (JMenu) owner;
    JPanel cont = containerMap.get(menu);
    
    if (cont == null) {
        cont = new VisualDesignerJPanelContainer(menu,this);
        cont.setLayout(new BoxLayout(cont, BoxLayout.Y_AXIS));

        RADVisualContainer menuRAD = (RADVisualContainer) canvas.formDesigner.getMetaComponent(menu);
        for(RADComponent c : menuRAD.getSubBeans()) {
            JComponent comp = (JComponent) canvas.formDesigner.getComponent(c);
            cont.add(comp);
        }
        
        cont.setBorder(BorderFactory.createLineBorder(Color.BLACK));
        containerMap.put(menu,cont);
        canvas.layers.add(cont, JLayeredPane.DEFAULT_LAYER);
    }
    
    cont.setSize(cont.getLayout().preferredLayoutSize(cont));
    canvas.validate();
    canvas.setVisible(true);
    final JPanel fcont = cont;
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            setLocationFromMenu(menu, fcont);
        }
    });
    
    canvas.validate();
    canvas.repaint();
    VisualDesignerJPanelPopup popup = new VisualDesignerJPanelPopup(cont, menu, this);
    popupMap.put(menu,popup);
    return popup;
}
 
Example 19
Source Project: netbeans   Source File: InnerPanelSupport.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void mouseMoved(MouseEvent e) {
    Point p = e.getPoint();
    int col = listClasses.columnAtPoint(p);
    int row = listClasses.rowAtPoint(p);
    
    if (col < 0 || row < 0) {
        hidePopup();
        return;
    }
    if (col == currentCol && row == currentRow) {
        // the tooltip is (probably) shown, do not create again
        return;
    }
    Rectangle cellRect = listClasses.getCellRect(row, col, false);
    Point pt = cellRect.getLocation();
    SwingUtilities.convertPointToScreen(pt, listClasses);
    
    RenderedImage ri = new RenderedImage();
    if (!updateTooltipImage(ri, row, col)) {
        return;
    }
    ri.addMouseListener(this);
    
    Popup popup = PopupFactory.getSharedInstance().getPopup(listClasses, ri, pt.x, pt.y);
    popupContents = ri;
    currentPopup = popup;
    currentCol = col;
    currentRow = row;
    popup.show();
    System.err.println("Hello");
}
 
Example 20
private void addStatistics(String kind, int count, int numRow,
        final MouseEvent e) {
  JLabel label = (JLabel)e.getComponent();
  if(!label.getToolTipText().contains(kind)) {
    // add the statistics to the tooltip
    String toolTip = label.getToolTipText();
    toolTip = toolTip.replaceAll("</?html>", "");
    toolTip = kind + " = " + count + "<br>" + toolTip;
    toolTip = "<html>" + toolTip + "</html>";
    label.setToolTipText(toolTip);
  }
  if(bottomSplitPane.getDividerLocation()
          / bottomSplitPane.getSize().getWidth() < 0.90) {
    // select the row in the statistics table
    statisticsTabbedPane.setSelectedIndex(1);
    oneRowStatisticsTable.setRowSelectionInterval(numRow, numRow);
    oneRowStatisticsTable.scrollRectToVisible(oneRowStatisticsTable
            .getCellRect(numRow, 0, true));
  } else {
    // display a tooltip
    JToolTip tip = label.createToolTip();
    tip.setTipText(kind + " = " + count);
    PopupFactory popupFactory = PopupFactory.getSharedInstance();
    final Popup tipWindow =
            popupFactory.getPopup(label, tip, e.getX()
                    + e.getComponent().getLocationOnScreen().x, e.getY()
                    + e.getComponent().getLocationOnScreen().y);
    tipWindow.show();
    Date timeToRun = new Date(System.currentTimeMillis() + 2000);
    Timer timer = new Timer("Annic statistics hide tooltip timer", true);
    timer.schedule(new TimerTask() {
      @Override
      public void run() {
        // hide the tooltip after 2 seconds
        tipWindow.hide();
      }
    }, timeToRun);
  }
}
 
Example 21
private void addStatistics(String kind, int count, int numRow,
        final MouseEvent e) {
  JLabel label = (JLabel)e.getComponent();
  if(!label.getToolTipText().contains(kind)) {
    // add the statistics to the tooltip
    String toolTip = label.getToolTipText();
    toolTip = toolTip.replaceAll("</?html>", "");
    toolTip = kind + " = " + count + "<br>" + toolTip;
    toolTip = "<html>" + toolTip + "</html>";
    label.setToolTipText(toolTip);
  }
  if(bottomSplitPane.getDividerLocation()
          / bottomSplitPane.getSize().getWidth() < 0.90) {
    // select the row in the statistics table
    statisticsTabbedPane.setSelectedIndex(1);
    oneRowStatisticsTable.setRowSelectionInterval(numRow, numRow);
    oneRowStatisticsTable.scrollRectToVisible(oneRowStatisticsTable
            .getCellRect(numRow, 0, true));
  } else {
    // display a tooltip
    JToolTip tip = label.createToolTip();
    tip.setTipText(kind + " = " + count);
    PopupFactory popupFactory = PopupFactory.getSharedInstance();
    final Popup tipWindow =
            popupFactory.getPopup(label, tip, e.getX()
                    + e.getComponent().getLocationOnScreen().x, e.getY()
                    + e.getComponent().getLocationOnScreen().y);
    tipWindow.show();
    Date timeToRun = new Date(System.currentTimeMillis() + 2000);
    Timer timer = new Timer("Annic statistics hide tooltip timer", true);
    timer.schedule(new TimerTask() {
      @Override
      public void run() {
        // hide the tooltip after 2 seconds
        tipWindow.hide();
      }
    }, timeToRun);
  }
}
 
Example 22
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
Example 23
Source Project: Bytecoder   Source File: MultiPopupMenuUI.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
Example 24
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
Example 25
Source Project: openjdk-jdk9   Source File: PopupMenuTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void dispose() throws Exception {
    SwingUtilities.invokeAndWait(() -> {
        Popup popup = PopMenuUIExt.getPopup();
        if (popup != null) {
            popup.hide();
        }
        frame.dispose();
    });
}
 
Example 26
Source Project: openjdk-jdk9   Source File: PopupMenuTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
    Popup popup = ((PopMenuUIExt) jpopup.getUI()).getPopup();
    if (popup != null) {
        isLightWeight = !popup.getClass().toString().
                contains("HeavyWeightPopup");
    }
}
 
Example 27
Source Project: jdk8u-jdk   Source File: MultiPopupMenuUI.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
Example 28
Source Project: Logisim   Source File: LayoutPopupManager.java    License: GNU General Public License v3.0 5 votes vote down vote up
public void hideCurrentPopup() {
	Popup cur = curPopup;
	if (cur != null) {
		curPopup = null;
		dragStart = null;
		cur.hide();
	}
}
 
Example 29
Source Project: Java8CN   Source File: MultiPopupMenuUI.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
Example 30
Source Project: hottub   Source File: MultiPopupMenuUI.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}