This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I have an applet which spawns a JFrame that includes a JMenuBar with associated pop-up menus. If you pop a menu and then close the window with the X button, the menu is frozen in place and can't be dismissed (although it is active) when the window is resdisplayed. We're caching our windows, so they don't get destroyed until the entire app is shut down, only hidden and reshown. I also found that we were recreating our menu everytime the window is displayed. I changed that to create the menu only once. Now when I resdisplay the window, I can actually "pick up" the frozen menu by moving the mouse over all menu options and it will get dismissed as normal when I select something or click in the frame. I saw another article that suggested this might be fixed in JRE1.3, but I tried this and it made no difference. If anyone has seen this, I'd really appreciate the help. Thanks
Have you tried putting code in your window closing method to either hide or close the menu? I think you may have to do that. e
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>"Those who cast the votes decide nothing. Those who count the<BR>votes decide<BR>everything." <BR> -Joseph Stalin<HR></BLOCKQUOTE>
Joined: Jan 31, 2001
Thanks for you time Eric. I though this was being done, but, it had actually been put in an ActionListener attached to the JMenuBar listening for hidden/shown events. These had no impact (because the window was alread invisible before the event fired?), but moving the code into the close window method takes care of my problem.