/** * Creates a <code>Popup</code> for the Component <code>owner</code> containing the Component * <code>contents</code>. In addition to the superclass behavior, we try to return a Popup that * has a drop shadow, if popup drop shadows are active - as returned by <code> * Options#isPopupDropShadowActive</code>. * * <p><code>owner</code> is used to determine which <code>Window</code> the new <code>Popup</code> * will parent the <code>Component</code> the <code>Popup</code> creates to. A null <code>owner * </code> implies there is no valid parent. <code>x</code> and <code>y</code> specify the * preferred initial location to place the <code>Popup</code> at. Based on screen size, or other * paramaters, the <code>Popup</code> may not display at <code>x</code> and <code>y</code>. * * <p>We invoke the super <code>#getPopup</code>, not the one in the stored factory, because the * popup type is set in this instance, not in the stored one. * * @param owner Component mouse coordinates are relative to, may be null * @param contents Contents of the Popup * @param x Initial x screen coordinate * @param y Initial y screen coordinate * @return Popup containing Contents * @throws IllegalArgumentException if contents is null * @see Options#isPopupDropShadowActive() */ public Popup getPopup(Component owner, Component contents, int x, int y) throws IllegalArgumentException { Popup popup = super.getPopup(owner, contents, x, y); return Options.isPopupDropShadowActive() ? ShadowPopup.getInstance(owner, contents, x, y, popup) : popup; }