/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package javaapplication2; import javax.swing.table.*; import javax.swing.plaf.basic.*; import java.awt.*; import javax.swing.*; public class CTUI extends BasicTableUI { public void paint(Graphics g, JComponent c) { Rectangle r = g.getClipBounds(); // int firstRow = table.rowAtPoint(new Point(0, r.y)); // int lastRow = table.rowAtPoint(new Point(0, r.y + r.height)); int firstCol = table.columnAtPoint( new Point( r.x , 0 ) ); int lastCol = table.columnAtPoint(new Point( r.x + r.width, 0 )); // -1 is a flag that the ending point is outside the table // if (lastRow