
Determining the Top Level Frame
Question: I have developed a custom AWT component that can be placed at any level in a component hierarchy. How can it determine the top level Frame in the hierarchy? Answer: When using components derived from JComponent, it is possible to usegetTopLevelAncestor() to determine the topmost enclosing container inthe component