Project: SWT
Bug 12811 TableColumns don't pack properly
Reported: 2002-04-04 11:48:32 | Status: resolved fixed

Build: 20020319 When calling pack() on a TableColumn, the columns are packed smaller than the preferred size. The label on the column header cannot be fully seen. This does not occur on Windows. Sample code: import org.eclipse.swt.*; import org.eclipse.swt.widgets.*; import org.eclipse.swt.layout.*; public class PR { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout (new GridLayout ()); Table table = new Table (shell, SWT.MULTI); table.setLinesVisible (true); table.setHeaderVisible (true); for (int i = 0; i < 10; i++) { TableItem item = new TableItem (table, 0); TableColumn column = new TableColumn (table, 0); column.setText ("Column " + i); column.pack (); } shell.pack (); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/Table.java