// return overlayCapableParent;
Component overlayChild = component;
overlayCapableParent = component.getParent();
if (overlay instanceof MayHaveMessagableTab)
{
MessagableTabbedPane tabbedPane;
while (overlayCapableParent != null && !(overlayCapableParent instanceof JRootPane))
{
if (overlayCapableParent instanceof MessagableTabbedPane)
{
tabbedPane = (MessagableTabbedPane) overlayCapableParent;
int tabIndex = tabbedPane.indexOfComponent(overlayChild);
((MayHaveMessagableTab) overlay).setMessagableTab(tabbedPane, tabIndex);
}
overlayChild = overlayCapableParent;
overlayCapableParent = overlayCapableParent.getParent();