Here you can find the source of updateRowHeights(JTable table)
public static void updateRowHeights(JTable table)
//package com.java2s; /**/*from www. jav a 2 s .com*/ * Created by ekipogh on 12.05.2015. licensed under WTFPL */ import javax.swing.*; import java.awt.*; public class Main { public static void updateRowHeights(JTable table) { for (int row = 0; row < table.getRowCount(); row++) { int rowHeight = table.getRowHeight(); for (int column = 0; column < table.getColumnCount(); column++) { Component comp = table.prepareRenderer(table.getCellRenderer(row, column), row, column); rowHeight = Math.max(rowHeight, comp.getPreferredSize().height); } table.setRowHeight(row, rowHeight); } } }