0

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);
Talon06
  • 1,756
  • 3
  • 27
  • 51

1 Answers1

1
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.

f4lco
  • 3,728
  • 5
  • 28
  • 53
  • In order to make it work I ended up using. tabHM.setControl(new hm_Forms.Comp_HM(tabFolder_main, SWT.NONE)); Thanks for pointing me in the right direction. – Talon06 Apr 20 '12 at 13:29