Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » how to resize a dialog and its content?
how to resize a dialog and its content? [message #447720] Thu, 16 December 2004 18:25
Eclipse UserFriend
Originally posted by:

I'm trying to figure out how to resize a dialog. I added the line below to
allow dialog resize. But the controls within the dialog do not resize. I
used GridLayout and GridData to layout the controls. When the dialog
resizes, the controls stay the same size. I thought the layout will auto
resize the controls. Can someone shed some light how I can make the controls
resize as well? Thanks!!! -- Vivian

public MyDialog(Shell parentShell)
setShellStyle(getShellStyle() | SWT.RESIZE); <<==== allow dialog

protected Control createContents(Composite parent)
// create the top level composite for the dialog
Composite composite = new Composite(parent, SWT.RESIZE);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.verticalSpacing = 0;
composite.setLayoutData(new GridData(GridData.FILL_BOTH));

// initialize the dialog units

// create the dialog area and button bar
dialogArea = createDialogArea(composite);
buttonBar = createButtonBar(composite);

// populate the controls in the dialog area

return composite;
Previous Topic:Drag and drop not working
Next Topic:[POCKET PC] SWT exception when creating tree
Goto Forum:

Current Time: Tue May 18 08:55:28 GMT 2021

Powered by FUDForum. Page generated in 0.02410 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top