Alternative to Preferences in Java

半腔热情 提交于 2019-11-26 08:37:23

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/6885961/alternative-to-preferences-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!