Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Which Layout for this question.
Which Layout for this question. [message #988209] Wed, 28 November 2012 14:52 Go to next message
drew frantz is currently offline drew frantz
Messages: 340
Registered: July 2009
Senior Member
Just want to place a single Text control in a Composite the occupies the
entire composite and stretches to fit when the composite is resized. Seems
simple, but I cannot figure out the magic.
Re: Which Layout for this question. [message #988260 is a reply to message #988209] Thu, 29 November 2012 02:46 Go to previous message
Christoph Keimel is currently offline Christoph Keimel
Messages: 328
Registered: December 2010
Location: Germany
Senior Member
You can try it like this:
Composite composite = new Composite(parent, SWT.None);
composite.setLayout(new FillLayout());
Text text = new Text(composite, SWT.BORDER | SWT.MULTI);

or like this
Composite composite = new Composite(parent, SWT.None);
composite.setLayout(new GridLayout());
Text text = new Text(composite, SWT.BORDER | SWT.MULTI);
text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

Hope this helps.
christoph
Previous Topic:visible children of ScrolledComposite
Next Topic:Periodic job with UI interaction on eclipse plugin
Goto Forum:
  


Current Time: Thu Jul 24 19:09:02 EDT 2014

Powered by FUDForum. Page generated in 0.01483 seconds