title: Is there any way to get a reference to the current frame in Java?
body: <p>I have a menu bar class (MenuBarGUI) that I have put in all of my other classes and I need to know if I can close the current JFrame that it is contained in through an option in the menu. Normally I could call setVisible(false) then dispose() but because the menu bar doesn't have a reference to the current frame, I can't do that. Is there any way to do this?</p>