/[classpath]/classpath/javax/swing/JComponent.java
ViewVC logotype

Diff of /classpath/javax/swing/JComponent.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20.2.13 by gnu_andrew, Sat Sep 10 15:31:48 2005 UTC revision 1.20.2.14 by gnu_andrew, Tue Sep 20 18:46:31 2005 UTC
# Line 452  public abstract class JComponent extends Line 452  public abstract class JComponent extends
452    /**    /**
453     * Add a client property <code>value</code> to this component, associated     * Add a client property <code>value</code> to this component, associated
454     * with <code>key</code>. If there is an existing client property     * with <code>key</code>. If there is an existing client property
455     * associated with <code>key</code>, it will be replaced.     * associated with <code>key</code>, it will be replaced.  A
456       * {@link PropertyChangeEvent} is sent to registered listeners (with the
457       * name of the property being <code>key.toString()</code>).
458     *     *
459     * @param key The key of the client property association to add     * @param key The key of the client property association to add
460     * @param value The value of the client property association to add     * @param value The value of the client property association to add
# Line 463  public abstract class JComponent extends Line 465  public abstract class JComponent extends
465     */     */
466    public final void putClientProperty(Object key, Object value)    public final void putClientProperty(Object key, Object value)
467    {    {
468        Hashtable t = getClientProperties();
469        Object old = t.get(key);
470      if (value != null)      if (value != null)
471        getClientProperties().put(key, value);        t.put(key, value);
472      else      else
473        getClientProperties().remove(key);        t.remove(key);
474        firePropertyChange(key.toString(), old, value);
475    }    }
476    
477    /**    /**

Legend:
Removed from v.1.20.2.13  
changed lines
  Added in v.1.20.2.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26