Anda di halaman 1dari 2

The main difference between Swing and Awt is that

Awt components are peer components to their


native counterparts. In other words when you
create a Button, the java code uses a native
component that the OS knows about for that
button. A drawing and event handing happens at
the OS eve. A!T istens for events and cas your
hooks for you to interact with them. This
impementation is usuay referred to as a
heavyweight component. A!T components are
heavyweight.
Swing is pure "ava. #ost of the components that
Swing uses are referred to as ightweight. Both
drawing and events are handed by "ava code. This
makes appications much more portabe mainy
because heavyweight event notification is
dependant on the OS$ impementation. %owever
since drawing is done by "ava code this paces a ot
of burden on performance of java. Swing is very
fe&ibe and very nice to work with. Swing aso
provides Pluggable LookandFeel feature.
'inay another major difference is that A!T does
not support fancy components ike tabes, trees
etc.

Anda mungkin juga menyukai