/[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.42 by rabbit78, Tue Jul 26 15:30:54 2005 UTC revision 1.43 by rabbit78, Fri Sep 30 13:11:05 2005 UTC
# Line 509  public abstract class AbstractButton ext Line 509  public abstract class AbstractButton ext
509    }    }
510    
511    /**    /**
512     * Creates a new AbstractButton object.     * Creates a new AbstractButton object. Subclasses should call the following
513       * sequence in their constructor in order to initialize the button correctly:
514       * <pre>
515       * super();
516       * init(text, icon);
517       * </pre>
518       *
519       * The {@link #init(String, Icon)} method is not called automatically by this
520       * constructor.
521       *
522       * @see {@link #init(String, Icon)}
523     */     */
524    public AbstractButton()    public AbstractButton()
525    {    {
     init("", null);  
526      updateUI();      updateUI();
527    
528        actionListener = createActionListener();
529        changeListener = createChangeListener();
530        itemListener = createItemListener();
531    
532        horizontalAlignment = CENTER;
533        horizontalTextPosition = TRAILING;
534        verticalAlignment = CENTER;
535        verticalTextPosition = CENTER;
536        borderPainted = true;
537        contentAreaFilled = true;
538        focusPainted = true;
539        setFocusable(true);
540        setAlignmentX(CENTER_ALIGNMENT);
541        setAlignmentY(CENTER_ALIGNMENT);
542        setDisplayedMnemonicIndex(-1);
543    }    }
544    
545    /**    /**
# Line 569  public abstract class AbstractButton ext Line 594  public abstract class AbstractButton ext
594    
595      if (icon != null)      if (icon != null)
596        default_icon = icon;        default_icon = icon;
   
     actionListener = createActionListener();  
     changeListener = createChangeListener();  
     itemListener = createItemListener();  
   
     horizontalAlignment = CENTER;  
     horizontalTextPosition = TRAILING;  
     verticalAlignment = CENTER;  
     verticalTextPosition = CENTER;  
     borderPainted = true;  
     contentAreaFilled = true;  
   
     focusPainted = true;  
     setFocusable(true);  
   
     setAlignmentX(LEFT_ALIGNMENT);  
     setAlignmentY(CENTER_ALIGNMENT);  
   
     setDisplayedMnemonicIndex(-1);      
597   }   }
598    
599    /**    /**

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

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