my main window has several menus(File, Edit, View, Help, etc). every menu has serveral menuitems(under Help menu, there is Help Topics, AboutBox). each muneItem can open a new window. The problem is the user can open as many windows as he wants without close the current one. What do i need to do to disable all the menus if there is window opens?
Thanks Gregg and Paul. All my windows are extend JFrame. I can't just simply enable/disable the menu. When the user runs the application, a main window opens. then he clicks a menuitem on the main window, the second windows opens in front of the main window. the user suppose can't do anything without close the second window. anywhere he clicks outside the second window, the second window should get focus and remind the user close the second window.
Well, if you are doing it that way, I would suggest using a JDialog instead of JFrame for your other windows outide of the main app. That way, they will have to close that new window before they could even do anything on the main app. However, I don't understand why you can't disable the menu items. Just because you are spawning a new JFrame doesn't mean you can't disable the Menu in the main Frame of your App. Unless you are using the same CLASS to create each new Window and each window contains the same menu bar. If that is the case, I say that is poor design.
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
Free, earth friendly heat - from the CodeRanch trailboss