Dashboard > UDIG Developer Guide > Home > 5 FAQ > Eclipse RCP Questions > How do I get an SWT layout to display properly
How do I get an SWT layout to display properly Log In | Sign Up   View a printable version of the current page.

Added by Cory Horner , last edited by Administrator on Nov 16, 2007  (view change)
Labels: 
(None)

Q: How do I get an SWT layout to display properly?

A: The size of a control sometimes defaults to zero width and height – this drives us all mad. The solution lies in the composite, rather than the control...

Method 1: call the layout() method

Composite parent = new Composite(grandParent, SWT.NONE);
...
(create controls)
...
parent.layout();

Method 2: resize the composite

  • programatically with parent.setSize(...)?
  • manually by the user
Powered by a free Atlassian Confluence Open Source Project License granted to uDig. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators
User-friendly Desktop Internet GIS