Class PreferencesChooser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class PreferencesChooser extends JPanel
The PreferencesChooser class is a panel that displays a Preferences object and allows the preferences to be manipulated.
Since:
3.1.7
Author:
Peter Hollemans
See Also:
  • Constructor Details

    • PreferencesChooser

      public PreferencesChooser(Preferences prefs)
      Creates a new enhancement preferences chooser with the specified preferences.
      Parameters:
      prefs - the initial preference settings.
  • Method Details

    • showDialog

      public static Preferences showDialog(Component component, String title, Preferences initialPrefs)
      Shows a preferences chooser in a dialog and blocks. If the user presses OK, then the dialog is disposed and the new preferences are returned. If the user presses Cancel or no preferences were changed, the dialog is disposed and null is returned.
      Parameters:
      component - the parent component for the dialog.
      title - the title for the dialog.
      initialPrefs - the initial preferences to show.
      Returns:
      the new preferences, or null if the user pressed cancel or did not make any changes.
    • getPrefsChanged

      public boolean getPrefsChanged()
      Gets the preferences changed flag.
      Returns:
      true if the preferences have been changed since the initialization, or false if not.
    • getPreferences

      public Preferences getPreferences()
      Gets the current preferences.
      Returns:
      the current preferences object.
    • main

      public static void main(String[] argv)
      Tests this class.
      Parameters:
      argv - the array of command line parameters.