java AbstractTableModel 2 Different Color For Each Row

前端 未结 3 804
傲寒
傲寒 2020-12-07 00:04

I want to increase readability of my jtable , here is MyTableModel.java class below , how to make each row with 2 different color shown in this picture . What should be t

3条回答
  •  有刺的猬
    2020-12-07 00:58

    long time ago, i had the same problem.

    In this case i use the JXTable from the swingX library instead of the JTable. This componenet has a great method:

    addHighlighter(HighlighterFactory.createSimpleStriping());
    

    good luck

提交回复
热议问题