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 |
/** |
/** |
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 |
/** |
/** |