Code example for Preferences

Methods: get, put

0
        set("imageFormat", value);
    } 
 
     
    public File getImageDirectory() {
        String dir = applicationPreferences.get("imageDirectory", null);
        if (dir != null) return new File(dir);
        return new File(".");
    } 
 
    public void setImageDirectory(File value) {
        File oldDir = getImageDirectory();
        applicationPreferences.put("imageDirectory", value.getAbsolutePath());
        savePreferences(); 
        propSupport.firePropertyChange("imageDirectory", oldDir, value);
    } 
 
 
    public boolean isAskBeforeScreenshot() { 
        try { 
            return applicationPreferences.getBoolean("askBeforeScreenshot", true);