You could use SwingUtilities.getWindowAncestor(...) method that will return a Window that you could cast to your top level type.
JFrame topFrame = (JFrame) SwingUtilities.getWindowAncestor(this);
You could use SwingUtilities.getWindowAncestor(...) method that will return a Window that you could cast to your top level type.
JFrame topFrame = (JFrame) SwingUtilities.getWindowAncestor(this);