Class Preferences

java.lang.Object
processing.app.Preferences

public class Preferences extends Object
Storage class for user preferences and environment settings.

This class does not use the Properties class because .properties files use ISO 8859-1 encoding, which is highly likely to be a problem when trying to save sketch folders and locations. Like the rest of Processing, we use UTF8.

We don't use the Java Preferences API because it would entail writing to the registry (on Windows), or an obscure file location (on Mac OS X) and make it far more difficult (impossible) to remove the preferences.txt to reset them (when they become corrupt), or to find the the file to make edits for numerous obscure preferences that are not part of the preferences window. If we added a generic editor (e.g. about:config in Mozilla) for such things, we could start using the Java Preferences API. But wow, that sounds like a lot of work. Not unlike writing this paragraph.

  • Constructor Details

    • Preferences

      public Preferences()
  • Method Details

    • get

      public static String get(String attribute)
    • getBoolean

      public static boolean getBoolean(String attribute)
    • getInteger

      public static int getInteger(String attribute)