Dimension areaSize = tc.getPreferredSize();
int lineSize = areaSize.height / lineCount;
int visibleLineSize = this.lines * lineSize;
((JScrollPane)tc.getParent().getParent()).setPreferredSize(new Dimension(currentSize.width, visibleLineSize));
} else if (this._component instanceof TextGraphic){
TextGraphic tg = (TextGraphic)this._component;
Font font = tg.getFont();
FontMetrics fm = tg.getFontMetrics(font);
int lineSize = fm.getHeight();
Dimension currentSize = tg.getPreferredSize();
int lineCount = tg.getLineCount();
tg.setPreferredSize(new Dimension(currentSize.width, (lineSize * lineCount)));
} else if (this._component instanceof OutlineField) { // CraigM: 15/10/2007
((OutlineField)this._component).setVisibleRows(this.lines);
}
}