Joel
Joel

Reputation: 3454

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 ?

Upvotes: 10

Views: 3202

Answers (1)

trashgod
trashgod

Reputation: 205785

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.

Upvotes: 12

Related Questions