Question: what is the difference between heavyweight and lightweight components explain with an example?
Answer: The difference between the two is that the Lightweight components are rendered (drawn) using purely Java code, such as drawLine and drawImage, whereas Heavyweight components use the native operating system to render the components.