There are the following methods: SwingUtilities.getWindowAncestor(Component c) and SunToolkit.getContainingWindow(Component c) that are used to retrieve the top-level root of the hierarchy for a given component.
These methods used in a number of places in the code Swing and AWT code. Lately we started to use them more often in order to determine whether the top-level window is non-opaque. This, however, seems to be done quite often: even the Swing repainting machinery (which should work as fast as possible) needs this information.
This change request is about adding a reference to the top-level component right in the Component object in order to be able to retrive it fast.