Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] How to insert a Control into a composite using FillLayout

Say, I have a Composite with the FillLayout. There are 3 Controls on this composite, text1, text2, text3. When right click on the text2 control, a pop-up menu with a item "Insert before" displays, click on this munu item, a new Text control will be insert between text1 and text2 on the composite. I wonder whether there is a smarter way to do this.
The stupid way I use currently to do this is like below:
----------------start here------------------------------
text3.dispose();
text2.dispose();
Text insertedText=new Text(composite,SWT.NONE);
text2=new Text(composite,SWT.NONE);
text3=new Text(composite,SWT.NONE);
---------------end here--------------------------------
I think it is to stupid, can any one show me a smarter way to do this?




Back to the top