Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to Preferences in Java

I'm using the Java Preferences API to store and retrieve small pieces of information in a swing/java application.

Now i have setup Java Web start to launch the application from my web page, and I get a security exception. In order to get rid of this exception, I'd have to prompt the user for permissions. And I refuse to do that because my application does nothing else that would require the user's permission.

That's why I need an alternative solution for storing a few key values from one execution to another. Some sort of cookie or whatever. Do you know any please ?

like image 406
Joel Avatar asked Jul 30 '11 21:07

Joel


1 Answers

You may want to look into using PersistenceService, a feature of Java Web Start that "provides methods for storing data locally on the client system, even for applications that are running in the restricted execution environment." Related examples may be found here and here.

like image 63
trashgod Avatar answered Oct 03 '22 21:10

trashgod