Java Swing set color of rows and columns based on index with defaulttablemodel -


i want able 2 things:

  1. set colors of rows based on index, first row red, second blue, third green
  2. be able set color of columns based on something, index or names etc, whatever possible.

i not need detect selection change or anything. tell me how that? methods etc? in case title wasn't read, regarding defaulttablemodel in jtables.

set colors of rows based on index,

table row rendering might give ideas.

be able set color of columns based on something

you can provide custom render column. can add logic color column based on something. read jtable api , follow link swing tutorial on how use table , find section on creating custom renderer.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -