answersLogoWhite

0


Best Answer

The basic difference between Swing and AWT is that Swing APIs are purely Java libraries i.e. they don't at all depend on the native libraries to draw graphical components. Because of this feature they provide a consistent look and feel on all platforms. AWT libraries require the support of native graphics libraries and some of their GUI components look different on different platforms. Moreover, Swing components are not inherently Thread safe, you explicitly have to write synchronized code to manipulate or redraw them whereas AWT components can be trusted in a multithreaded environment. AWT Components are called heavyweight components because of their dependency on native libraries. Swing components are called lightweight due to their independence of native libraries. Hence Swing operations are much faster because each and every operation is taken care by the Java runtime env and no delegation of events or commands to the native libraries is required.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

Lightweight framework do not have to depend on framework interfaces or abstract classes to hook or instantiate components into them.

Heavyweight frameworks on the other hand require the extension of framework classes or the implementation of framework interfaces in order to take advantage of their middleware features.This means that a lot of classes are instantiated and hooked on to your application when they may not be even required!!

Lightweight framework (may be just my point of view) is a standalone/independent implementation of a feature- set.

Heavyweight frameworks Also more often than not we are dependent on some or other kind of container to support the framework features.

I could categorize EJB 2.x as Heavyweight framework, When you write an application in EJB 2.x (my apologies to all EJB fans ), your code is highly dependent on EJB classes and interfaces. I think EJB 3 is much better in this respect, but I am not sure.

Frameworks like Struts/Hibernate are lightweight because your application code has minimal dependencies on these frameworks.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Lightweight framework do not have to depend on framework interfaces or abstract classes to hook or instantiate components into them.

Heavyweight frameworks on the other hand require the extension of framework classes or the implementation of framework interfaces in order to take advantage of their middleware features.This means that a lot of classes are instantiated and hooked on to your application when they may not be even required!!

Lightweight framework (may be just my point of view) is a standalone/independent implementation of a feature- set.

Heavyweight frameworks Also more often than not we are dependent on some or other kind of container to support the framework features.

I could categorize EJB 2.x as Heavyweight framework, When you write an application in EJB 2.x (my apologies to all EJB fans ), your code is highly dependent on EJB classes and interfaces. I think EJB 3 is much better in this respect, but I am not sure.

Frameworks like Struts/Hibernate are lightweight because your application code has minimal dependencies on these frameworks.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: In Java what is the difference between heavyweight and lightweight components?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Why volt meter is always placed in parallel?

Because the quantity it measures is 'EMF' or 'potential difference', that is,the difference in potential between two points. There may be 1 or 1,000circuit components between the two points.


What is the difference between PCB and bread board?

with a bread board you do not need to solder the components. you can just place them in the holes and remove them as you please.


What is the difference between module and software components?

This depends somewhat on the methodology you are using. They may actually be just different names for the same thing.


What is the difference between technical componenets and professional components of Radiological services?

Technical component involves taking of radiographs while professional involves reading them


Difference between active and passive elements?

Active components can deliver a finite amount of power for some finite amount of time period where passive components can not deliver finite amount of power for some finite amount of time.

Related questions

Difference between electronics components and the schematic symbols?

difference between electronics components and the schematic symbols


How many weight classes in UFC mixed martial arts?

fly weight 116-125pounds bantamweight 126-135pounds featherweight 136-145 lightweight 146-155 welterweight 156- 170 middleweight 171-185 lightheavy weight 186-205 heavyweight 206-265


What is difference between biotic and abiotic components of the environment?

The difference between an abiotic and biotic enviorment is an abiotic enviorment had living organisms in it while a biotic enviorment contains nonliving organisms.


What is the difference between a mural and a banner?

A mural is a painting on a wall. A banner is a lightweight sign that can be easily moved to any location.


What is the difference between wheat and rice straw?

components of the 2 straws are different


difference between simple and fractional distillation?

The key difference between fractional and simple distillation is that fractional distillation is used when the components in the mixture have closer boiling points, while simple distillation is used when the components in the mixture have a large difference in their boiling points


What's the difference between a jacket and coat?

A jacket is a lightweight outer garment. A coat is a bit heavier and longer for the winter months.


What is the major components of the photosynthesis process?

What is the difference between a deciduous plant and an evergreen plant


What is the difference between complex and complicated?

The difference between complex and complicated is that 'complex' refers to many different components, whereas "complicated" refers to a high level of difficulty.


How is the mass defect determined?

The mass of a nucleus is subtracted from the sum of the masses of its individual components.


What is the difference between law and science?

Science is based on scientific laws. Laws are components of the science.


Is there a difference between intake and exhaust hydraulic valve lifters?

No the lifters themselves are all the same. I recommend lightweight pushrods though if you can get them and stay with hydraulic.