public static void fitAllRowHeights(JTable table) {
        int rowCount = table.getRowCount();
        for (int row = 0; row < rowCount; row++) {
            fitRowHeight(table, row);
        }
    }