使用XML和Java Swing Synth LaF设置按钮的字体颜色

|| 我正在使用Java Swing Synth外观。我可以指定几个组件的样式。但是,我无法为默认状态设置按钮的字体颜色。按钮的文本始终显示为黑色,但是当在鼠标上聚焦/选择/移动鼠标时,文本颜色将变为白色,然后变为黑色。 这是我的synth-XML文件的摘要:
<synth>
<style id=\"defaultStyle\">
    <font name=\"Dialog\" size=\"16\" />
</style>
<bind style=\"defaultStyle\" type=\"region\" key=\".*\" />
<style id=\"button\">
   <property key=\"Button.textShiftOffset\" type=\"integer\" value=\"1\"/>
   <state>
      <imagePainter method=\"buttonBackground\" path=\"./images/JButton/default.png\"
           sourceInsets=\"20 24 20 24\" paintCenter=\"true\" stretch=\"true\"/>
      <insets top=\"20\" left=\"24\" bottom=\"20\" right=\"24\"/>
      <color type=\"TEXT_FOREGROUND\" value=\"#FFFFFF\"/>
   </state>
</style>
<bind style=\"button\" type=\"region\" key=\"Button\" />
...
</synth>
难道我做错了什么?如何更改按钮的默认字体颜色? 一些其他信息: Java 1.6 Windows 7(32位)     
已邀请:
        好像是我设法解决了。出于未知原因,我不得不使用色标\“ FOREGROUND \”。     
        试试这个
<style id=\"button\">
   <property key=\"Button.textShiftOffset\" type=\"integer\" value=\"1\"/>
   <font name=\"Dialog\" size=\"12\"/>
   <state>
      <imagePainter method=\"buttonBackground\" path=\"./images/JButton/default.png\"
           sourceInsets=\"20 24 20 24\" paintCenter=\"true\" stretch=\"true\"/>
      <insets top=\"20\" left=\"24\" bottom=\"20\" right=\"24\"/>
      <color type=\"TEXT_FOREGROUND\" value=\"#FFFFFF\"/>
   </state>
</style>
<bind style=\"button\" type=\"region\" key=\"Button\" />
该链接可能对您有用。     

要回复问题请先登录注册