3 Replies Latest reply on Dec 27, 2007 10:33 AM by ntsiii

    add to a container by creating only one instance of a component

    lucky_raga
      Hi,

      I have a VBox to which i add few components by iterating over a collection of some values,
      there is a possiblity for a value to occur more than once, but i want to only add the component once,
      VBox vbox = new VBox();
      if (_value) {
      CarComponent car = new CarComponent();
      vbox.addChild(car); //add car component only once, how to?
      }

      Please suggest.

      Thanks,
      Lucky