tags:

views:

51

answers:

2

what is a difference between component and the class extend composite in gwt?

+1  A: 

what do you mean "component"?

Both com.gwtext.client.widgets.Component and com.extjs.gxt.ui.client.widget.Component are GWT-wrappers over base ext-js class, which has show/hide, enable/disable functionality. They are abstract and not used by themself.

But com.google.gwt.user.client.ui.Composite is

widget that can wrap another widget, hiding the wrapped widget's methods. ... The composite is useful for creating a single widget out of an aggregate of multiple other widgets contained in a single panel.

It is ordinary widget, and may be used in building UI.

zmila
A: 

See Composition Instead Of Inheritance.

In GWT you usually want to create some reusable component which is composed from several widgets. In this case you should use Composite to hide details of container Panel, for example to prevent users of your component from using Panel specific methods.

Konstantin Scheglov