In my Swing app. I have a JFrame
with few JPanels
. One of it I use for placing another panels. And one of these - another panel - calls a JDialog
. Constructor of dialog accepts Frame
, String
and Boolean
as parameters. My problem is how to get parent (which is frame) from this panel?
SwingUtilities.windowForComponent(...)
and SwingUtilities.getWindowAncestor(...)
do not work in my case. Constructor with no parameters is not an option.