I have a form in SWT where I have five different composites based on one parent composite.Each of the composite contains different widgets like a single textbox / a combo box / a combination of text and combo etc.
Now the problem is when I click on the button I want to change my third composite to carry a different widget keeping others static.Now I can't reload from the beginning as I want current values of the other widgets to be displayed.How can I fetch only that composite,dispose it and create a new widget in place of that.
Creating and hiding the widget is difficult to consider as it is dynamic to at what place we want to redraw.
Here is the snippet.
formComposite=new Composite(parentComposite,SWT.BORDER_SOLID);
formLayout=new GridLayout(5,false);
fromComposite.setLayout(formLayout)
item.create(formComposite) //Here item is the widget (combo/textbox/combination text/combo)
formComposite1=new Composite(parentComposite,SWT.BORDER_SOLID);
formLayout1=new GridLayout(5,false);
fromComposite1.setLayout(formLayout)
item1.create(formComposite1))
formComposite2=new Composite(parentComposite,SWT.BORDER_SOLID);
formLayout2=new GridLayout(5,false);
fromComposite2.setLayout(formLayout)
item2.create(formComposite2))
formComposite3=new Composite(parentComposite,SWT.BORDER_SOLID);
formLayout3=new GridLayout(5,false);
fromComposite3.setLayout(formLayout)
item3.create(formComposite3))
formComposite4=new Composite(parentComposite,SWT.BORDER_SOLID);
formLayout4=new GridLayout(5,false);
fromComposite4.setLayout(formLayout)
item4.create(formComposite4))
Now how can I replace item3 with a different item to be created keeping others static in their place?
BORDER_SOLID
is not a valid style for aComposite
. – greg-449