aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes SWT: Is dynamic resize of Combo possible? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "SWT: Is dynamic resize of Combo possible?" Watch "SWT: Is dynamic resize of Combo possible?" New topic
Author

SWT: Is dynamic resize of Combo possible?

Bhavani Kumar
Greenhorn

Joined: Feb 22, 2005
Posts: 15
Hi all,
My scenario is : I have 2 combos in a Composite. Depending on the value selected in the first Combo, the second Combo is populated. Now the values in the second combo are of variable length, so i need to resize the combo depending on the length of the text. Is it possible, since we place the combos on the composite in the beginning itself ?

Code:

msgFmtCmb = new Combo(paramComp, SWT.READ_ONLY);
gridData = new GridData();
gridData.horizontalSpan = 2;
msgFmtCmb.setLayoutData(gridData);
msgFmtCmb.addModifyListener(this);

msgTypeCmb = new Combo(paramComp, SWT.READ_ONLY);
final GridData grdDataMsgType = new GridData();
grdDataMsgType.horizontalSpan = 2;
msgTypeCmb.setLayoutData(grdDataMsgType);
msgTypeCmb.addModifyListener(this);

In the modifyText method, i am removing all values from the second combo and adding new values.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SWT: Is dynamic resize of Combo possible?