Resizing Rows and Columns in Java-Client Tables

In a Java-client table, there are two main mechanisms for sizing rows and columns. The table can automatically determine an appropriate size for a cell, or you can set sizes explicitly. End users can drag the boundaries of cells to resize rows and columns as well, to set the sizes explicitly.

The table uses default sizes for columns and rows, and it also automatically sizes columns and rows for you. It bases automatic sizes on the data in the cell, the size of the font in which the data is displayed, whether word wrapping is enabled for the cell, and so on. Each time new data is displayed in the table, cells are automatically resized, for better readability. As the sizes of columns and rows change, the table changes the default sizes as necessary.

Controlling automatic resizing

You can set properties of the table to specify what the table should automatically resize and how it should determine sizes. The following table lists properties that affect automatic sizing in a table, with a description of each. These properties are defined in the oracle.dss.gridView.GridView class.

Property

Description

AutoFitScope

Tells the table what to autofit, such as row heights, column widths, column widths in the row headers, row heights in the column headers, and so on.

AutoFitRowCount

Tells the table how many rows to consider when it calculates an autofit size; the default value is 20

AutoFitColumnCount Tells the crosstab how many columns to consider when it calculates an autofit size; the default value is 20

For finer control over autofitting, you can implement callbacks and register them with the table. To have the table consider a particular set of rows, create and register an AutoFitRowRangeCallback. To have the table consider a particular set of columns, create and register an AutoFitColumnRangeCallback.

Controlling manual sizing

By default, users can change the size of columns in the databody. They cannot change row height in the table. The following table lists properties, with their descriptions, that allow you to control what users can resize by dragging borders with the mouse.

Property

Description

ManualRowSizingEnabled

Specifies whether users can manually change the height of the rows in the databody

ManualColumnSizingEnabled

Specifies whether users can manually change the width of the rows in the databody

Properties that manual resizing sets

The following table lists table properties, with their descriptions, that specify manually set sizes for cells. When users drag cell boundaries to resize parts of a table, these properties are automatically set.

Sizing property

Description

ColumnWidth

The width of a column in the databody

RowHeight

The height of a row in the databody