java.awt.MenuBar: How can I interrupt the user?

I have a dynamic menubar (it can change content while the application is running). If the user is navigating in the Menu-system at the same time as the menu-content is changing, the jvm crashes (windows says that java.exe has performed an illegal operation). Question:

can the program close a Menu while a user is interacting with it? (hopefully avoiding the crash)

audun

[397 byte] By [audus] at [2007-9-26 1:13:38]
# 1
I don't know the answer to your question, but I think it's a no.Wouldn't it be an idea that you disable the menu (and menu-items) and then modify the menu-structure and once it is modified you enable it again?
MartijnR at 2007-6-29 0:10:40 > top of Java-index,Archived Forums,Java Programming...
# 2

This doesn't solve his problem if the user is in the middle of interacting with the menu.

Btw, I do a similar thing in my applicaiton and it works fine. I'm using JDK 1.3.1 and JDK 1.4 Beta.

I have a submenu and the JMenuItems on the submenu can change dynamically. However, if the user has the submenu open, he won't see the change until the next time he opens the submenu.

schillj at 2007-6-29 0:10:40 > top of Java-index,Archived Forums,Java Programming...