Beyond that, I'm not going to discuss the disadvantages here. Please see my earlier lessons on this topic for more information. 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.