SWT Use Composite from File

69 views Asked by At

I am trying to use a composite that I have created in a separate file in my app. I am unsure how to set the control of my tab to the compsoite file.

Package: hm_forms Composite File: Comp_HM.java Main File: Frm_Main.java Control: tabHM

I am thinking its got to be close to.

Composite Comp_HM = hm_Forms.Comp_HM;
tabHM.setControl(Comp_HM);
1

There are 1 answers

1
f4lco On BEST ANSWER
Composite Comp_HM = hm_Forms.Comp_HM;
tabHM.setControl(new Comp_HM());

You have to create an instance of your custom composite and pass it into the setControl method.