Java – make Jface tableviewer use the composite around it to resize?

Using WindowBuilder for eclipse, I created a tableviewer, which is placed in a complex (tableviewer creates an SWT table in which the tableviewer itself is inserted)

I tried to make the composite resizable by setting grabexcesshorizontalspace and grabverticalspace to true, but how do I make the table and tableviewer fill the composite?

Solution

It's hard to say there's no code, but from your description, you don't set the layout on your composite Try adding composite setLayout(new FillLayout()); If your composite contains only tableviewer

If your composition has multiple children, you need a different layout, such as GridLayout or miglayout Then, you must also set layoutdata and other children of the compound on the table

Here are some clips showing how to use GridLayout For a better miglayout, see here

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>