如何在Jtable中更改特定行的颜色 [英] How Do I Change Colour For A Specific Row In Jtable
本文介绍了如何在Jtable中更改特定行的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请向我解释如何根据值更改jtable中特定行的颜色。例如,在名为gender的列中,我希望所有男性都有蓝色行,所有女性都有粉红色行
please explain to me how i can change the colour of a specific row in a jtable based on a value . for instance in a column named gender i would like all the male to have blue rows and all the female to have pink rows
推荐答案
Google有很多建议 [ ^ ]。
JTable Tutorial @ oracle.com [ ^ ]
请参阅使用自定义渲染器部分。
JTable Tutorial @oracle.com[^]
Please refer to the section "Using Custom Renderers".
这篇关于如何在Jtable中更改特定行的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文