// --------------------------------------------------------------------
// Expand array fields
// --------------------------------------------------------------------
if (comp instanceof ArrayField) {
ArrayField af = (ArrayField)comp;
af.setVisibleRows(af.getRowCount());
if (removeScrollBars) {
((JScrollPane)af.getParent().getParent()).setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
((JScrollPane)af.getParent().getParent()).setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
}
// Expand any text fields that are in the array field
for (int i=0; i<af.getColumnCount(); i++) {
TableCellRenderer cellRenderer = af.getCellRenderer(0, i);
if (cellRenderer instanceof ArrayFieldCellRenderer &&
((ArrayFieldCellRenderer)cellRenderer).getRenderer() instanceof TextFieldCellRenderer) {
((TextFieldCellRenderer)((ArrayFieldCellRenderer)cellRenderer).getRenderer()).setPrinting(removeScrollBars);
}
}
Container parent = af.getParent();
while (parent != null) {
if (parent instanceof JFrame) {
((JFrame)parent).validate();
((JFrame)parent).pack();