/[classpath]/classpath/javax/swing/plaf/metal/MetalTextFieldUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/metal/MetalTextFieldUI.java

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

revision 1.1.2.3 by gnu_andrew, Tue Aug 2 20:12:38 2005 UTC revision 1.1.2.4 by gnu_andrew, Wed Nov 2 00:44:01 2005 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package javax.swing.plaf.metal;  package javax.swing.plaf.metal;
40    
 import java.util.HashMap;  
   
41  import javax.swing.JComponent;  import javax.swing.JComponent;
42    import javax.swing.JTextField;
43  import javax.swing.plaf.ComponentUI;  import javax.swing.plaf.ComponentUI;
44  import javax.swing.plaf.basic.BasicTextFieldUI;  import javax.swing.plaf.basic.BasicTextFieldUI;
45    
46  public class MetalTextFieldUI  /**
47    extends BasicTextFieldUI   * A UI delegate for the {@link JTextField} component.
48     */
49    public class MetalTextFieldUI extends BasicTextFieldUI
50  {  {
   
   /** The UI instances for MetalTextFieldUIs */  
   private static HashMap instances = null;  
   
51    /**    /**
52     * Constructs a new instance of MetalTextFieldUI.     * Constructs a new instance of MetalTextFieldUI.
53     */     */
# Line 60  public class MetalTextFieldUI Line 57  public class MetalTextFieldUI
57    }    }
58    
59    /**    /**
60     * Returns an instance of MetalTextFieldUI.     * Returns a new instance of <code>MetalTextFieldUI</code>.
61     *     *
62     * @param component the component for which we return an UI instance     * @param component the component for which we return an UI instance
63     *     *
64     * @return an instance of MetalTextFieldUI     * @return A new instance of <code>MetalTextFieldUI</code>.
65     */     */
66    public static ComponentUI createUI(JComponent component)    public static ComponentUI createUI(JComponent component)
67    {    {
68      if (instances == null)      return new MetalTextFieldUI();
       instances = new HashMap();  
   
     Object o = instances.get(component);  
     MetalTextFieldUI instance;  
     if (o == null)  
       {  
         instance = new MetalTextFieldUI();  
         instances.put(component, instance);  
       }  
     else  
       instance = (MetalTextFieldUI) o;  
   
     return instance;  
69    }    }
70  }  }

Legend:
Removed from v.1.1.2.3  
changed lines
  Added in v.1.1.2.4

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