All Wicket components are designed to be extended.
Extension can be simple: an anonymous class to link to another page, for instance.
If you have the same component component on several pages, like a search form,
you can encapsulate it into an easily reusable component.
Components are added to other components, including a special type of component called a MarkupContainer.
MarkupContainers are special because, in addition to Java code,
they have an associated markup file, like HTML.
Pages and Panels are the two most common types of MarkupContainers you'll encounter.
We'll look at both later in the example application.
Let's look at a simple wireframe of a hypothetical page with components:
In the above illustration, our Page object has multiple components,
including two Panels, a Form with multiple FormComponents (drop down, text field, radio buttons, etc.) and a Link.
Child components are added to a single parent component, essentially creating an inverted tree:
Component references must appear in the markup in the same structure as the code.
For example, an exception is thrown if you add one of the Buttons outside the
To summarize, Wicket components are Java classes with supporting HTML markup.
Most Wicket components are designed to be customized for your specific needs.
Components may be customized by creating anonymous classes or concrete subclasses.
Components work with Models, which are the subject of the next section.