No. That is
not the correct way to do it.
JInternalFrame has a method called getDesktopPane() which returns you the JDesktopPane instance.
JDesktopPane subclasses JComponent.
If you invoke JDesktopPane#getTopLevelAncestor() you will get the reference to the parent JFrame.
Since you did not bother to answer
You cannot embed JFrame inside another JFrame. Did you mean JDesktopPane and JInternalFrame instead?
I am not sure if I should waste any more of my time, trying to help you out in the future.
Best of luck with your coding and have a nice day.