Container

A container (jcontrol.ui.vole.Container) can hold an arbitrary amount of further containers or components. The input focus will be transferred from one component to another within a container until the last component or subcontainer is reached. The focus will then move on to the next container in which it will again be handed off from one component to the next. So it makes sense to organise components that belong together into one container. The order in which the components receive the focus is the same as the one in which the components were added to the container or frame respectively.

Furthermore will all operations applied to a container affect all the contained child components: If, for example, a container is deleted by using the method remove(), all components within it will be deleted and removed from the user interface as well.

The most important methods of the class Container are listed and briefly described in the following table (Table 1):

MethodDescription
Container(int x, int y, int width, int height)Creates a new Container with the specified dimensions.
add(Component c)Adds a new Component to the Container. The contained components will be drawn in the order in which they were added.
remove(Component c)Removes a component from the Container.
removeAll()Removes all components from the Container.
remove()Removes all components from the Container and the Container itself.
transferFocus()Forces the focus to be transferred to the next Component
Table 1: Methods of the class jcontrol.ui.vole.Container

A complete list of all methods of this class including a detailed description can be found in the JControl API documentation.