Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between AWT & Swing?

Answer Posted / tushar

1.Swing is also called as JFC’s (Java Foundation classes)
and AWT stands for Abstract windows toolkit.

2.AWT components are called Heavyweight component and
Swings are called light weight component because swing
components sits on the top of AWT components and do the
work.

3. Swing components require javax.swing package where as
AWT components require java.awt package .

4.swings components are made in purely java and they are
platform independent whereas AWT components are platform
dependent.

5.we can have different look and feel in Swing whereas this
feature is not supported in AWT.

6.Swing has many advanced features like JTabel, Jtabbed
pane which is not available in AWT. Also. Swing components
are called "lightweight" because they do not require a
native OS object to implement their functionality. JDialog
and JFrame are heavyweight, because they do have a peer. So
components like JButton, JTextArea, etc., are lightweight
because they do not have an OS peer.

7.With AWT, you have 21 "peers" (one for each control and
one for the dialog itself). A "peer" is a widget provided
by the operating system, such as a button object or an
entry field object.

8.With Swing, you would have only one peer, the operating
system's window object. All of the buttons, entry fields,
etc. are drawn by the Swing package on the drawing surface
provided by the window object. This is the reason that
Swing has more code. It has to draw the button or other
control and implement its behavior instead of relying on
the host operating system to perform those functions.

9.Several consequences result from this difference between
AWT and Swing. AWT is a thin layer of code on top of the
OS, whereas Swing is much larger. Swing also has very much
richer functionality.

10.Using AWT, you have to implement a lot of things
yourself, while Swing has them built in. For GUI-intensive
work, AWT feels very primitive to work with compared to
Swing. Because Swing implements GUI functionality itself
rather than relying on the host OS, it can offer a richer
environment on all platforms Java runs on.

Is This Answer Correct ?    20 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to include the internal frame in swing.

1006


What class is at the top of the AWT event hierarchy?

1107


How to perform action on button in java swing?

958


What is actionlistener in java swing?

1031


Which types of components are used in designing swing based gui?

1025


Is swing thread-safe?

1004


How to reload a jframe in java swing?

1032


What are controls and what are different types of controls in awt?

1029


Explain the difference between jfc & wfc.

1053


What are the components of java swing?

1010


How to link two forms in java swing?

1180


How to render an html page using only swing.

1004


What is difference between jframe and swing?

961


What's java swing?

1010


What are the advantages of the event-delegation model over the event-inheritance model?

1106