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.
I have this app that has a JFrame with a menu, and some JInternalFrames inside that. Each JInternalFrame has its own menuitem on the menu. How can I get the menuitem to go away when its JInternalFrame is closed? I tried to find this information on the Sun tutorial site but couldn't find it. I tried several ways already but nothing has worked. A code snippet would be very much appreciated. - SA
Hi, a way to do this is two ways. 1. Add a InternalFrame Listener and listen for the close event. On that event do myMenu.remove(myMenuItem) 2. Another way would be do disable the close option on the InternalFrame in the upper right corner and create a Close Button somewhere on the InternalFrame. And then add a Listener to the button and do the same as #1 above when the button is pressed but also do a dispose() for the Internal Frame to get rid of it. Hope that helps