aspose file tools
The moose likes Java in General and the fly likes Singleton in SWING Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Singleton in SWING" Watch "Singleton in SWING" New topic
Author

Singleton in SWING

Gavin Bong
Ranch Hand

Joined: Apr 25, 2003
Posts: 56
I have a singleton that generates monotonically increasing ids for
my SWING app. Although the singleton will be unloaded when the SWING app terminates; I suspect that the app will be running for like 8 hours a day. Is there a way to replace the singleton ?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24057
    
  13

Replace it why?


[Jess in Action][AskingGoodQuestions]
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
Your singleton will of course be unloaded once your application is terminated and exit JVM. Are you saying you want the id to keep increment even after close and restart of your application?
In that case, I guess you can serialized your counter class.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Singleton in SWING
 
Similar Threads
how can I open sava as dialog window
Storing Session Values in Swing (Possible?)
getting information from GUI
Prompt for location when file is downloading
How does singleton work in client/server app?