• Post Reply Bookmark Topic Watch Topic
  • New Topic

Pop-up window that remember users.

 
H garous
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'd like to have a popup window (that gives what's new in the application) when users logged into my application, and provide a check box on that pop-up window for not showing it next time the user logged in. So the application should remember the user who chooses not to see the popup window next time. In a web application, I would do this using cookies stored in user's machine to remember next time he/she log in.
How can I do this using java swing?
 
Rahul Saple
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could make use of a file that saves all the preferences made by the user and then have it read everytime the application starts.
[ March 13, 2008: Message edited by: rahul saple ]
 
H garous
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, but I don't think that would work. There are alot of users, everytime a user entered something new, I have to show it to all other users, then let them choose to see it or not next time they log in. And once there's something new that they haven't seen yet I have to show the popup window. I am thinking about storing their choses in a DB table, but I don't want to over engineer it. If I could do something similar to cookies, it would be perfect.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by H garous:
Hi,

.. user who chooses not to see the popup window next time. In a web application, I would do this using cookies stored in user's machine to remember next time he/she log in.


This is not foolproof is it? What if the user logs in from a different machine? Or if the cookies are cleared? Or the user starts using a different browser?
Ideal thing to do would be store it centrally in a database.
Of course this depends on what exactly your requirement is. If you are OK with the cookie approach with the limitations, similar way to do it in Swing would be to maintain a proprties file (easiest approach in my opinion). I had taken this approach in one of my previous applications, where I was maintaining a properties file in the "user.home" directory. This helped me in cases where multiple users were using the same machine. And yes, please dont forget to provide the defaults, to avoid the null pointer exception!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!