However the impatient or those with only a passing interest should be able to grasp the basic ideas and mechanisms of Swing from this document. In X11 terms, components are roughly equivalent to widgets. In Swing, all components are subclasses of JComponent , an abstract GUI object. JComponent provides the methods and structure common to all concrete components. For example, all components have a size, so size accessor methods are implemented in JComponent and inherited by the concrete subclasses that represent actual rendered objects, like buttons.
Containers store components.
In GUI development one often finds that there are sets of components, for example a group of three buttons, that are related in function. It is convenient to be able to aggregate these sets of components so that they can be treated as one object. For example they can all be assigned the same font or foreground color. Additionally, grouping related components together makes it easier to arrange them on the screen. Instead of assigning positions to each of our three buttons, we can group them together and place the button container where we want it.