GeekInterview.com
Series: Subject: Topic:
Question: 4 of 76

Why swing is called as light weighted component?

Asked by: Interview Candidate | Asked on: Oct 11th, 2007
Showing Answers 1 - 4 of 4 Answers
sarathi

Answered On : Oct 24th, 2007

Beausethe componentare created by the java itself not by theoperating system.

  
Login to rate this answer.

the components are created by the own package not by operating system

  
Login to rate this answer.
Kinjal Das

Answered On : Aug 25th, 2008

View all answers by Kinjal Das

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

  
Login to rate this answer.
shilpad

Answered On : Sep 5th, 2008

View all answers by shilpad

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.

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.