• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help JMenu is getting frozen and won't go away

 
Martha Cofran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
eric moon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Martha Cofran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic