/** * Returns a medium weight <code>Popup</code> implementation. If the <code>Popup</code> needs * more space that in available in <code>owner</code>, this will return null. */ static Popup getMediumWeightPopup(Component owner, Component contents, int ownerX, int ownerY) { MediumWeightPopup popup = getRecycledMediumWeightPopup(); if (popup == null) { popup = new MediumWeightPopup(); } popup.reset(owner, contents, ownerX, ownerY); if (!popup.fitsOnScreen() || popup.overlappedByOwnedWindow()) { popup.hide(); return null; } return popup; }