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

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

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

revision 1.18 by mark, Mon Aug 9 22:29:15 2004 UTC revision 1.19 by mark, Sat Sep 4 17:14:01 2004 UTC
# Line 444  public abstract class AbstractButton ext Line 444  public abstract class AbstractButton ext
444      }      }
445    
446    /**    /**
    * Helper class used to subscribe to FocusEvents received by the button.  
    */  
   private class ButtonFocusListener implements FocusListener  
     {  
     /**  
      * Possibly repaint the model in response to loss of focus.  
      *  
      * @param event The loss-of-focus event  
      */  
     public void focusLost(FocusEvent event)  
         {  
       if (AbstractButton.this.isFocusPainted())  
         AbstractButton.this.repaint();  
     }  
   
     /**  
      * Possibly repaint the button in response to acquisition of focus.  
      *  
      * @param event The gained-focus event  
      */  
     public void focusGained(FocusEvent event)  
     {  
       if (AbstractButton.this.isFocusPainted())  
         AbstractButton.this.repaint();  
     }  
   }  
   
   /**  
447     * Creates a new AbstractButton object.     * Creates a new AbstractButton object.
448     */     */
449    public AbstractButton()    public AbstractButton()
# Line 552  public abstract class AbstractButton ext Line 524  public abstract class AbstractButton ext
524      borderPainted = true;      borderPainted = true;
525      contentAreaFilled = true;      contentAreaFilled = true;
526    
527      iconTextGap = 4;      focusPainted = true;
528        setFocusable(true);
529    
530      setAlignmentX(LEFT_ALIGNMENT);      setAlignmentX(LEFT_ALIGNMENT);
531      setAlignmentY(CENTER_ALIGNMENT);      setAlignmentY(CENTER_ALIGNMENT);
532    
     addFocusListener(new ButtonFocusListener());  
533      setDisplayedMnemonicIndex(-1);          setDisplayedMnemonicIndex(-1);    
534   }   }
535    

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

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