I’m trying to follow the advice I’ve seen in this forum that using frames is the way to go if we want reuse common components.
For example I have a UI element combination that I’m using in multiple places. It has two button components. I’ve wrapped these components in a Frame and I want to use this frame in a dialog that I open with via openWindow() method.
This all works fine however, I’m stuck when it comes to how to obtain a reference to the parent window. Occasionally I need to access some property, method, etc. of the enclosing window or (frame) from the child frame.
I can call getParent() which returns type Component. I can cast that to Window but that seems unreliable as I might have frames nested multiple levels deep.
Also is there a way to pass parameters to the child frame upon initialization?