How to maintain session in swing desktop application,
I want to store some data when login,I want to get this data anywhere in the application,
Right now I use system properties to set this login data,
May be due to this ,application slow sometimes,
Any body help me out,thankful
Most real problems in programming boil down to live, visibility, and scope. You are describing the grand problem of visibility. If you have a controller or main class that launches all other classes and you make a data structure in that class, then when your start your application and instantiate your other objects, you will be able to reference that structure that stores the data you want--in other words all of your object will have visibility of that structure, because they are created in the same scope (class in this case) as the storage structure. Your storage object will then have life during the entire run of your program because your "main controller class" will need to be running during your entire session.
So, make a class, then define a structure to store your data as an instance variable--global variable with respect to your "controller class", and you'll have what you need.
Out on HF and heard nobody, but didn't call CQ? Nobody heard you either. 73 de N7GH
Would you like to try a free sample? Today we are featuring tiny ads:
professionally read, modify and write PDF files from Java