Skip to content

Commit cd67c87

Browse files
hansonrhansonr
authored andcommitted
working more on button/label ui update
1 parent ef7ed52 commit cd67c87

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSComponentUI.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,15 +967,13 @@ protected void propertyChangedCUI(String prop) {
967967
return;
968968
}
969969
if (prop == "text") {
970-
if (centeringNode != null) {
971970
String val = ((AbstractButton) c).getText();
972971
if (val == null ? currentText != null : !val.equals(currentText))
973972
setIconAndText(prop, currentIcon, currentGap, (String) val);
974-
}
975973
return;
976974
}
977975
if (prop == "iconTextGap") {
978-
if (centeringNode != null) {
976+
if (iconNode != null) {
979977
int gap = ((AbstractButton) c).getIconTextGap();
980978
if (currentGap != gap)
981979
setIconAndText(prop, currentIcon, gap, currentText);
@@ -1984,7 +1982,7 @@ private ImageIcon getIcon(JSComponent c, Icon icon) {
19841982

19851983
protected void setIconAndText(String prop, Icon icon, int gap, String text) {
19861984

1987-
if (centeringNode == null)
1985+
if (iconNode == null && textNode == null)
19881986
return;
19891987

19901988
// TODO so, actually, icons replace the checkbox or radio button, they do not

0 commit comments

Comments
 (0)