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