All Implemented Interfaces:
Serializable, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable
Direct Known Subclasses:
DataTable.Caption, NavigatorLabel, SmartLinkLabel

public class Label extends WebComponent
A Label component replaces its body with the String version of its model object returned by getModelObjectAsString().

Exactly what is displayed as the body, depends on the model. The simplest case is a Label with a static String model, which can be constructed like this:

 add(new Label("myLabel", "the string to display"))
A Label with a dynamic model can be created like this:
       add(new Label("myLabel", new PropertyModel(person, "name"));
In this case, the Label component will replace the body of the tag it is attached to with the 'name' property of the given Person object, where Person might look like:
 public class Person
        private String name;
        public String getName()
                return name;
        public void setName(String name)
       = name;
Jonathan Locke
See Also: