In article <. com>,
"John_Woo" <> wrote:
[ snip ]
> Thanks Steve.
>
> Can you tell how to make java app write an entry to Registry <for
> windows os>?
>
> the last question was: any simple way for an app to set system
> properties, and other app <event though same app, but running in other
> folder> can get this properties?
>
> --
> John
I gave you the clue to what I was suggesting in the earlier post, which
is the use of Preferences in Java (introduced in 1.4).
<
http://java.sun.com/j2se/1.4.2/docs/...eferences.html
>
<
http://java.sun.com/j2se/1.5.0/docs/...eferences.html
>
You might use the static systemNodeForPackage method there, for example.
If you have a class at com.acme.myclass, the system-level preference
node would be created for "com.acme". On Windows, it happens that the
stored preference data would be in the Registry. But that's not really
important. What is important is that information can be placed there
once and then is accessible to other users in the same way to read it.
A warning is in order, though, if you want to use this for communication
between running applications. It's not a good idea and may not work
reliably.
And Preferences may still not be the best solution for whatever problem
you're actually trying to solve, which you haven't actually said clearly
so far.
--
Steve W. Jackson
Montgomery, Alabama