开发者

Want to create a table using org.eclipse.swt.widgets.Table, working on a pugin project

I am adding only three columns to the table but an extra column is also being displayed, I want exactly three columns. While resizing the window the column size is not increasing , what should i do. I am using GridLayout, should I use other开发者_如何学运维 layout.

Thanks in advance.


The last column is not a real column, but only exists to make up the difference between the table width and the sum of table columns width. Instead of displaying an empty area, the SWT Table widgets shows an "empty" synthetic column. Afaik the only way to make this table column go away is to automatically resize the real table columns to fit the whole width of the table control itself.

See java2s for an example how to resize table columns to fit the size of the table control automatically. Basically, it's adding a ControlListener to the table control which recalculates the column widths using the preferred column width and setting it manually.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜