我是XML新手,也是Java Synth LAF新手。
我已经将以下XML样式文件正确加载到我的UIManager中:
<synth>
<style id="default">
<font name="Segoe UI" size="16"/>
</style>
<bind style="default" type="region" key=".*"/>
<style id="button">
<opaque value="true">
<insets top="10" bottom="10" left="10" right="10"/>
<state>
<color type="BACKGROUND" value="#FFFFFF"/>
<color type="TEXT_FOREGROUND" value="#000000"/>
</state>
</opaque>
</style>
<bind style="button" type="region" key="Button"/>
默认样式运行良好,但由于某些原因按钮样式不起作用。
提前感谢
发布于 2020-02-04 14:28:47
The opaque element - Synth File Format
opaque元素是空元素,因为它是用category关键字EMPTY声明的。
<!ELEMENT opaque EMPTY>
<!ATTLIST opaque
value (true|false) "true"
><synth>
<style id="default">
<font name="Segoe UI" size="16"/>
</style>
<bind style="default" type="region" key=".*"/>
<style id="button">
<opaque value="true"/>
<insets top="10" bottom="10" left="10" right="10"/>
<state>
<color type="BACKGROUND" value="#FFFFFF"/>
<color type="TEXT_FOREGROUND" value="#000000"/>
</state>
</style>
<bind style="button" type="region" key="Button"/>
</synth>https://stackoverflow.com/questions/60041274
复制相似问题