Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / April 2006

Tip: Looking for answers? Try searching our database.

Another instance of same window.

Thread view: 
kalpesh - 24 Apr 2006 13:44 GMT
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.
Thomas A. Russ - 24 Apr 2006 17:04 GMT
> 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

Murdoc - 24 Apr 2006 22:27 GMT
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.