In an application, there would be numerous scenarios where we would have to add components ranging from a simple field to a panel at runtime as part of the response to the user event. For example, your application may have a payment panel where you may want to show the payment specific detail panels based on the payment method. If a user selects Credit Card
as the payment method, then you may show a panel asking the user to enter their credit card detail. This requires us to add components dynamically to an existing container. In this recipe, we will see how to work with components at runtime.
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.