TransparentLayeredPane () { for (int i = 0; i < myPane.getComponentCount(); i++) { Component c = myPane.getComponent(i); if (c instanceof TransparentLayeredPane) { return (TransparentLayeredPane)c; } } return null; }