How can one change the Preferences path?

Hello,
I've recently discovered the Preferences API and try to learn how to use it but I'm stuck on a problem right now: Is the only place to store my keys/values inside the "JavaSoft/prefs" node?
I have this piece of code so far:
     * The method used to store preference If no package is specified, the
     * current class' package will be used
     * @throws NullPointerException
     *                 If key or value is null.
     * @throws IllegalArgumentException
     *                 If key.length() exceeds MAX_KEY_LENGTH or if value.length
     *                 exceeds MAX_VALUE_LENGTH.
     * @throws IllegalStateException
     *                 If this node (or an ancestor) has been removed with the
     *                 removeNode() method.
     * @throws BackingStoreException
     *                 If this operation cannot be completed due to a failure in
     *                 the backing store, or inability to communicate with it.
    public void storePreference() throws IllegalArgumentException, NullPointerException, IllegalStateException,
         BackingStoreException
     // The node which will be used is the user specified one
     Preferences prefs = Preferences.userRoot().node(this.tree);
     //We add the listener here so that it is instantiated with the constructor
     prefs.addNodeChangeListener(this);
     prefs.addPreferenceChangeListener(this);
     prefs.put(this.keyName, this.keyValue);
     // Make sure the change is commit
     prefs.flush();
    }Where tree is the path (absolute) where to write data.
The problem is, whatever the way I approach the thing, I always end in something like:
|---+JavaSoft
| |---+Prefs
| |---MyNode: MyKeys / MyValues
When I would like something like
|---+JavaSoft
| |---+Prefs
|
|---+MyApplicationName
| |---+UserSettings
| | |---Edvard: MyKeys / MyValues
Hope I've been clear enough.
Thanks in advance for helping.
Edited by: airchtit on Jan 31, 2008 6:50 AM

While you can't specify arbitary sub-trees and especially not a specific position in the Registry (as the previous posters noted), you should not use userRoot() to store your preferences, but rather use "userNodeForPackage(SomeClassFromYourApplication.class)".
This way it will be ensured that your preferences nodes will not clash with those of other applications.

Similar Messages

  • How can I change the preference order of stored wi-fi networks?

    How can I change the preference order of stored wi-fi networks? (My iPhone keeps trying to connect to a weaker network that I occasionally use - even when there's a stronger network stored in the system which I want to rank higher)

    If you know and have entered and connected successfully to the weaker network whenever you come near it it will automatically connect to it.
    If you want it to connect it to the stronger network you should go to the wireless settings and connect to the stronger one when both the networksare in range.this will make your stronger network as the default network connection.

  • How can i change the default path of installation

    I had creative cloud for a while. Today i changed the default installing folder, from the creative cloud settings/prefferences(can't remember) menu, from C to D. Then i uninstalled all the programs from adobe cs6 to take the new cc programs. When i want to reinstall adobe creative cloud it is installing on D and since there is no operating sistem on D i can't install the creative cloud. It keeps installing on D. How can i change the default path of installation if i uninstalled creative cloud?

    Or how can I change the prefered installation folder that can be changed from creative cloud menu/prefferences when i have uninstalled creative cloud?

  • How can I change the installation path  of JWS?

    I have to install the JRE 1.4.0_01 in silent mode on Windows XP. For the JRE I can set the installation path in the corresponding dialog and record it in an *.iss file. When starting the silent installation the JRE is correctly installed into this path but the Java Webstart installation procedure doesn't care about this path and installs JWS in 'D:\Programme\Java Web Start'.
    How can I change the installation path for JWS?
    J�rg

    Verify Free Disk Space. Assuming you are installing the OS to the C: drive.

  • How can one change the color of JToolTip background

    how can one change the color of JToolTip background from Purple to user defined ? I am using setToolTipText() method to set the text required but here the background color of the ToolTip is Purple and i wish to change it to white.. how can i do it ?
    i tried to change the color by defining a seperate class JToolTip but i don't know how to set it with a JButton..
    can someone help..
    thanks in advance ..
    avinash

    How can I change the text size and font?Give a man a fish.... Check out UIManager.

  • How can one change the channel of a screen control within Mainstage?

    The issue that I'm having is that some 3rd party apps (Dimension Pro in particular) seem to receive Sustain (64) messages on only Midi Channel 1
    I'm using a multi zone controller, with sounds set in MainStage to respond to different channels. I've got it all working well except . . Dimension Pro won't "see" a controller message if it's sent from any channel other than channel 1.
    I was even having the same problem with certain sounds in Kontakt.
    So the question is . . how can one shift the channel of these messages over to channel 1?
    Better question, how can I get Dimension Pro to respond to a controller on a channel other than 1, but I suspect this is not the forum for such questions!
    Thanks in advance,
    Mark
    MacOS 10.7.3
    MainStage 2.1.3
    Axiom 61 (2nd gen) keyboard controller

    You may be able to achieve the desired results by a different method. I have an Axiom, but I don't assign zones in it. I just send one zone to Mainstage and handle it all there. You can layer and or split a practically unlimited number of instruments and assign screen controls easily. You probably want to set up all screen controls at the concert level in layout mode. You can later override concert mapping in individaul patches if you want. For instance, you could use an expression pedal for volume(7) on one patch and for modulation(1) on another patch. You can send that control to one instument channel strip or you can choose to send to all. To do this, select a screen control in edit mode. In the screen control inspector, check the overide concert mapping box. You will then see two additional tabs-mappings and unmapped. Select the mappings tab. In the mapping list, double-click "Unmapped". You can the map the screen control to any single  instrument channel strip in this list or send to all. Select one and then choose a mapping destination. If you want to map expression to one instrument and not others there's another way. Select an instrument channel strip, then selct MIDI input in the software channel strip inspector. Check the filter expression box. This instument will now not respond to expression, but the other intruments in this patch will. You can filter some other events on this page. The layer editor tab allows you full control ol splits and layering options of all your instruments in this patch. Hope this helps.

  • How can I change the folder path to my library

    I just changed the file path to my locally stored music from C:\MyStuff\...\iPod Nano Music\... to C:\OneDrive\...\iPod Nano Music\...
    Is there a way I can edit the path that Apple has locally stored to redirect iTunes to the new, correct location instead of (as I've had to do previously) deleting all the music files in iTunes and then adding each music folder back?
    In Advanced Preferences the 'iTunes media folder location' shows as C:\Users\Mark\Music\iTunes\iTunes Media with an edit button. However this is not the location of all my music files (as indicated above).
    Mark

    If you want to move your media to a new path what you should do is edit the media folder preference in iTunes and then consolidate to that new path. Moving the media first by hand and then trying to fix iTunes is generally the wrong approach.
    Your options are to move everything back where it came from, then consolidate to the new path, then delete the originals that iTunes leaves behind. Alternatively you should be able to use my FindTracks script to reconnect the relocated media to iTunes. See this post for an explanation of how it works.
    See also Make a split library portable for reasons why splitting the media folder to a new path may be undesirable.
    tt2

  • How can one change the order of the issues (folios) in a custom viewer?

    Hi,
    I am trying to find how one can determine the order that the issues (folios) will appear in a custom viewer (multi-folio with subscriptions).
    I tried to rearrange the order by changing the publication date in the Folio Producer Oorganizer, but it has no effect in the iPad custom viewer.
    Thanks

    The publication date settings determine the order of the folios in the library, so that should work. Did you update the folios?

  • How can I change the setting to one appropriate to java1.2

    Hello.
    I am using WebLogic 4.5.1 .
    and recently started to use JDK 1.2 instead of JDK 1.1.7.
    So, I set [start]-[weblogic]-[Choose1.2JRE] in environment.
    and then, if I execute T3Server, the message of
    "javai.dll class path cannot be found " is displayed and the server is not
    loaded.
    However, javai.dll was in java1.1.X\bin.
    I can assume that a setting is to java1.1.X.
    --> How can I change the setting to one appropriate to java 1.2
    It's my environment
    ClassPath
    .;c:\weblogic\classes;C:\weblogic\lib\weblogicaux.jar;C:\weblogic\license;c:
    \weblogic;C:\weblogic\myserver\clientclasses;C:\weblogic\myserver\serverclas
    ses;C:\weblogic\myserver\servletclasses;C:\weblogic\mssqlserver4\classes;c:\
    weblogic\classes\boot;C:\weblogic\eval\cloudscape\lib\cloudscape.jar;c:\rmi-
    iiop\lib\iioprt11.jar;c:\rmi-iiop\lib\iioprt.jar;c:\rmi-iiop\lib\rmiorb.jar;
    C:\jsdk2.1\runner.jar;C:\jsdk2.1\servlet.jar
    Path :
    %SystemRoot%\system32;C:\jdk1.3bin;c:\weblogic;c:\weblogic\bin;
    c:\;c:\bat;c:\util\;C:\jsdk2.0\bin
    Hyung Gi Min

  • HT204053 How can I change the apple ID that is set up on my mac to match the one on my phone so they can sync

    I have inadvertently set up two apple ID accounts - now, I am trying to use iCloud to sync everything but my mac has one ID and my phone has another.  How can I change the one on my mac?  the one on my phone is the one that has the extra storage.

    Navigate to system preferences > iCloud and sign out of your account, then sign back in using the correct details.

  • How can I change the default apple ID for app store. I bought the macbook from my school when I left and I'm the ID in place of mine is the computer departments one. How can i change it to mine?? Thanks

    How can I change the default apple ID for app store. I bought the macbook from my school when I left and I'm the ID in place of mine is the computer departments one. How can i change it to mine?? Thanks

    http://support.apple.com/kb/ht5621

  • When my husband and I first bought our iPhones, I was the only one with an Apple ID (since he never used iTunes). He used my apple id to get apps. Now he has his own ID, but my account keeps popping up on his phone. How can we change the ID on his phone?

    When my husband and I first bought our iPhones, I was the only one with an Apple ID (since he never used iTunes). He used my apple id to get apps. Now he has his own ID, but my apple ID email address keeps popping up on his phone when he tries to download an app. We do not want to have all of the same apps on our phones. How can we change the ID on his phone? I already tried going to Settings>iTunes &App Store> and changing the Apple ID to his account email and that did not solve the problem. To make things worse, I recently changed my Apple ID email address (without getting a new ID) and I do not remember my old password (and this is the address that is popping up on his phone). He does not have any music on his phone and all of the Apps that he has are free.  Any help you could offer would be great (-:

    All apps are forever tied to the Apple ID that bought them. To stop your id from popping up, you need to delete the apps on his phone, and then repurchase them under his account.

  • 2 different iphones have the same Apple ID, how can I change the apple ID on one of them but not delete the other iphone's data and media?

    2 different iphones have the same Apple ID, how can I change the apple ID on one of them but not delete the other iphone's data and media?

    You don't have to do anything with the first iPod that you don't use anymore. If you are planning on keeping it, put in a drawer in your house and forget about it.
    You don't need a second account to use with the new iPod. I use one Appl e ID and iTunes library for two iPods, and two iPad. I have different content on all four devices. You can select exactly what you want to sync to each device and it can be different content on all devices.

  • I forgot my password along with the answers to my security questions. So I try sending an E-Mail to myself but the E-Mail I am sending it to isn't even mine, nor the one I have registered. How can I change the E-Mail or something?

    I forgot my password along with the answers to my security questions. So I try sending an E-Mail to myself but the E-Mail I am sending it to isn't even mine, nor the one I have registered. How can I change the E-Mail or something?

    Security questions:
    https://discussions.apple.com/thread/4533485?tstart=0

  • How can I change the itunes store from Swiss to the Italian one on my ipad2 with new software ios6? Thanks

    How can I change the itunes store from Swiss to the Italian one on my ipad2 with new software ios6? Thanks

    See More Like This to the right of this post!

Maybe you are looking for