The Preference Editor below is an example of a minimal but fully functional preferences editor. It has:

This code is the basis for the Preferences Framework tutorial.