问题
I am struggling to reduce the size of components within the scrolled composite. The problem is , always components(Tableviewer) getting bigger size.Unable to reduce the size.i tried setSize method of components .But no effect
public void createForm(final Form form, final FormToolkit toolkit) {
parent = toolkit.createComposite(form.getBody());
GridLayout singleCol = new GridLayout(1, true);
canvas.setLayout(singleCol);
GridData fillData = new GridData(SWT.FILL, SWT.FILL, true, true);
// fillData.widthHint = 10;
parent.setLayoutData(fillData);
textArea = new DescriptionSection(this, parent, toolkit);
ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
columns = toolkit.createComposite(sc);
columns.setLayout(new GridLayout(2, true));
columns.setLayoutData(fillData);
left = toolkit.createComposite(columns);
left.setLayout(singleCol);
left.setLayoutData(fillData);
right = toolkit.createComposite(columns);
right.setLayout(singleCol);
right.setLayoutData(fillData);
tableViewerSection1 = new TableViewerSection1(this, left, toolkit);
tableViewerSection2 = new tableViewerSection2(this, left, toolkit);
tableViewerSection3 = new tableViewerSection3(this, left, toolkit);
tableViewerSection4 = new TableViewerSection4(this, right, toolkit);
tableViewerSection5 = new TableViewerSection5(this, right, toolkit);
tableViewerSection6 = new TableViewerSection6(this, right, toolkit);
sc.setContent(columns);
sc.setExpandHorizontal(true);
sc.setExpandVertical(true);
sc.setMinSize(columns.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
Please help me how to reduce the size whenver minimize and maximize the size of the form? Tableviewer1 and al tables couldnt reduce size. :-(
来源:https://stackoverflow.com/questions/25550955/how-to-reduce-composite-size-within-the-scrolledcomposite-in-swt