如何设置JTable的行颜色

问题描述

是否有一种简单的方法来更改JTable中行的颜色?

table = new JTable(9,6);
table.setRowHeight(30);
table.setRowHeight(3,15);
table.setRowHeight(6,25);
table.setGridColor(Color.BLACK);
sl_layeredPane.putConstraint(SpringLayout.norTH,table,10,SpringLayout.norTH,layeredPane);
sl_layeredPane.putConstraint(SpringLayout.WEST,SpringLayout.WEST,layeredPane);
sl_layeredPane.putConstraint(SpringLayout.soUTH,-10,SpringLayout.soUTH,layeredPane);
sl_layeredPane.putConstraint(SpringLayout.EAST,440,layeredPane);
layeredPane.add(table);
    

到目前为止,这就是JTable的全部功能。 看起来像这样:

https://i.stack.imgur.com/Uhq4S.png

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)