Why swing is called as light weighted component?

Showing Answers 1 - 4 of 4 Answers

sarathi

  • Oct 24th, 2007
 

Beause the component are created by the java itself not by the operating system.

  Was this answer useful?  Yes

Kinjal Das

  • Aug 25th, 2008
 

Let try to understand what is heavywheight component. If We see AWT Components (Earlier Java versions), while painting the components a very thick 3D frame is drawn. Hence the name of Heavy weight.

And the reason why that heavy look is to come is because AWT being a very thin layer, used to delegate all the painting work to the underlying Operating System native methods(Non java methods). Swings on the other hand uses the Graphics Object (Provided by Java itself) to draw the diagrams. Hence that heavy doesn't come up.

I guess that answer the question

  Was this answer useful?  Yes

shilpad

  • Sep 5th, 2008
 

A heavyweight component is one that is associated with its own  native screen resource (commonly known as a peer). A lightweight component(swing) is one that "borrows" the screen resource of an ancestor  (which means it has no native resource of its own -- so it's "lighter").
That is why swing is called light weight component.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions