Color


JTable Alternate Row Color 7
Java tables are great but complex. The good thing about them is that you can do with them whatever you want. Even more, the view is completely separated from the model so you can even play more. JTables in brief (bad thing) are just a bunch of components put together. So anything you can de to a Component you can do in a JTable. To make a JTable render each row in a different color, you just have to extend the JTable’s prepareRender method. [crayon-5bc452abdb073271719884/] The above code simply gets the component that was going to be rendered and changes […]

JTable Alternate Row Background