import java.awt.Rectangle;
import javax.swing.JFrame;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;


/**
 *
 * @author pardesha
 */
public class RepaintTest {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    JFrame frame = new JFrame();
    TableModel model = new DefaultTableModel(
        new String[][] { { "A0", "B0" }, { "A1", "B1" }, { "A2", "B2" }, { "A3", "B3" } },
        new String[] { "A", "B" });
    JTable table = new JTable(model);
    frame.add(table);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setSize(200, 200);
    frame.setVisible(true);
    SwingUtilities.invokeLater(() -> repaintRows(table));
  }

  private static void repaintRows(JTable table) {
    // get Rectangle for second row
    Rectangle r = table.getCellRect(1, 0, true);
    // expand cell rectangle to affect (parts of) third row
    r = new Rectangle(0, r.y, table.getWidth(), r.height * 2);
    table.repaint(r);
  }
    
}