我想通过 Synth LookAndFeel xml 配置更改JTable
和样式。JTree
但是我只发现有一小部分可以通过xml
文件配置来实现(eg. high-line, cell-color...)。比如单元格边框、表头之间的分界线、表格选中单元格的背景色等都没有找到可配置的入口。
代码如下:
enter code here
<style id="tableStyle">
<state>
<color type="BACKGROUND" value="WHITE"/>
<color type="FOREGROUND" value="BLACK"/>
<color value="LIGHT_GRAY" type="TEXT_BACKGROUND"/>
<color value="BLACK" type="TEXT_FOREGROUND"/>
<imagePainter method="tableBorder" path="images/textfield.png"
sourceInsets="1 1 1 0" paintCenter="false"/>
</state>
<object class="javax.swing.plaf.ColorUIResource" id="color">
<int>255</int>
<int>0</int>
<int>0</int>
</object>
<property key="Table.gridColor" type="idref" value="color"/>
</style>
<bind style="tableStyle" type="region" key="Table"/>
enter code here
是否可以通过 XML 配置在图像中实现样式?谢谢。