1
Answer

How to set odd color in jtable?

Sai Yang

Sai Yang

4y
768
1
I am using java 8.2. Upon this code, how can I set background color for the opposite row?
  1. UIDefaults defaults = UIManager.getLookAndFeelDefaults();  
  2. if (defaults.get("Table.alternateRowColor") == null) {  
  3. defaults.put("Table.alternateRowColor"new Color(252, 242, 206));  
  4. }  
I want the opposite row different from default color. Now it's white.
Answers (1)