To put it simply, Java depends on the underlying operating system to render all heavyweight components. This has several disadvantages, the most obvious of which is that the components look different when the same Java program is run under different operating systems. Lightweight components are components that are rendered exclusively using the drawing primitives of Java. Look and feel is independent of OS As a result, to a very large extent, the look and feel of a lightweight component is independent of the operating system under which the program is running. The look and feel of a lightweight component can be changed at runtime.
Lightweight components can have transparent backgrounds.
A container is a component that can contain other components in a parent-child sense. A Swing button is a container, but it is not a top-level container. Therefore, you cannot cause a Swing button to be rendered directly on the computer screen alongside Microsoft Word or some other application that is running. However, you can cause a Swing button to be rendered as a child of a JFrame object, which can be rendered on the operating system desktop alongside Microsoft Word or Netscape Navigator. It is possible for you to mix heavyweight and lightweight components, although I would advise you to do so only if absolutely necessary.