> i have an application in which after selecting an item from JMenuBar
> another window is opened.Again selecting the same option the window is
> opened once again.
> I want that once a particular window is opened another instance of same
> window should not open.
Have the menu action that creates the window disable the menu item.
You will also want to have the close action for that window enable the
menu item for creating it again.

Signature
Thomas A. Russ, USC/Information Sciences Institute
> i have an application in which after selecting an item from JMenuBar
> another window is opened.Again selecting the same option the window is
> opened once again.
> I want that once a particular window is opened another instance of same
> window should not open.
Whenever the menu item is selected for the first time, add an entry for the instance into a
List/Map with a mapping of:
<UniqueMenuItemID>,<WindowInstance>
The next time the menu item is selected, look for the entry in the list. If it is there, and the
WindowInstance is still valid, then you can apply focus to the original window. Otherwise, you will
want to re-create the window, and update the list.