331 |
/** The gap between the icon and the text. */ |
/** The gap between the icon and the text. */ |
332 |
private transient int iconTextGap = 4; |
private transient int iconTextGap = 4; |
333 |
|
|
|
/** The accessible context for this JLabel. */ |
|
|
private AccessibleJLabel accessibleContext; |
|
|
|
|
334 |
/** |
/** |
335 |
* Creates a new vertically centered, horizontally on the leading edge |
* Creates a new vertically centered, horizontally on the leading edge |
336 |
* JLabel object with text and no icon. |
* JLabel object with text and no icon. |
400 |
this.text = text; |
this.text = text; |
401 |
this.icon = icon; |
this.icon = icon; |
402 |
this.horizontalAlignment = horizontalAlignment; |
this.horizontalAlignment = horizontalAlignment; |
403 |
|
setAlignmentX(0.0F); |
404 |
updateUI(); |
updateUI(); |
405 |
} |
} |
406 |
|
|
475 |
{ |
{ |
476 |
if (text != newText) |
if (text != newText) |
477 |
{ |
{ |
478 |
String oldText = text; |
String oldText = text; |
479 |
text = newText; |
text = newText; |
480 |
firePropertyChange("text", oldText, newText); |
firePropertyChange("text", oldText, newText); |
481 |
|
|
482 |
if (text != null && text.length() <= displayedMnemonicIndex) |
if (text != null && text.length() <= displayedMnemonicIndex) |
483 |
setDisplayedMnemonicIndex(text.length() - 1); |
setDisplayedMnemonicIndex(text.length() - 1); |
484 |
|
revalidate(); |
485 |
|
repaint(); |
486 |
} |
} |
487 |
} |
} |
488 |
|
|