• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help JMenu is getting frozen and won't go away

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic