Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8298350

properties installed by javax.swing.LookAndFeel installColors and installColorsAndFont are not uninstalled

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 21
    • client-libs
    • None
    • behavioral
    • low
    • Hide
      These are new methods so the risk of adding them is very low.
      Any risk is more associated with implementation code which adopts these.
      Show
      These are new methods so the risk of adding them is very low. Any risk is more associated with implementation code which adopts these.
    • Java API
    • SE

      Summary

      Create two new methods to provide consistent and centralised behaviour to remove LookAndFeel installed colors and fonts from Swing components.

      Problem

      There are convenience methods to install colors and fonts, but no inverse methods to remove them. Consequently the removals are performed manually and inconsistently.

      Solution

      Implement two new public API convenience methods which mirror other similar convenience methods.

      Provided L&Fs are updated to use these.

      Specification

      Provide two new convenience methods on the class javax.swing.LookAndFeel

      +    /**
      +     * Convenience method for removing a component's foreground
      +     * and background color properties by setting them to null.
      +     *
      +     * @see #uninstallColorsAndFont
      +     * @see #installColors
      +     * @param c component from which to remove the colors
      +     */
      +    public static void uninstallColors(JComponent c) 
      
      
      +    /**
      +     * Convenience method for removing a component's foreground color,
      +     * background color and font properties by setting them to null.
      +     *
      +     * @see #uninstallColors
      +     * @see #installColorsAndFont
      +     * @param c component from which to remove the colors and font
      +     */
      +    public static void uninstallColorsAndFont(JComponent c) 

            jwaters Julian Waters
            cushon Liam Miller-Cushon
            Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: