tableComposite.addControlListener(new ControlAdapter() {
public void controlResized(ControlEvent e) {
Rectangle area = comp.getClientArea();
Point size = tref.computeSize(SWT.DEFAULT, SWT.DEFAULT);
ScrollBar vBar = tref.getVerticalBar();
int width = area.width - tref.computeTrim(0,0,0,0).width - 2;
if (size.y > area.height + tref.getHeaderHeight()) {
Point vBarSize = vBar.getSize();
width -= vBarSize.x;
}
Point oldSize = tref.getSize();