This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
This is perhaps a dumb question, but I will ask it anyway I have a JFrame. I have a JPanel inside my JFrame. I put a Cancel button on the JPanel. I want the Cancel button to hide my JFrame, i.e. setVisible(false)
How does my Cancel button on my JPanel reference the JFrame that the JPanel is sitting in? More specifically, since it's easy for the button to get a reference to the JPanel, how does the JPanel get a reference to the JFrame so that it can make the JFrame invisible?