ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Java Related >> Java J2EE >> Swing
 
 


 

 
 Core Java interview questions  Core Java Interview Questions (1722)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (44)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (196)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (147)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
Question
What is the difference between AWT & Swing?
 Question Submitted By :: Swing
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
AWT are heavy weight components while Swing are light
weight components.
 
Is This Answer Correct ?    335 Yes 27 No
Guest
 
Answer
# 2
AWT are heavy weight components while Swing are light
weight components.

Light weight components have transparent pixels where as
heavy weight is always opaque.

Light weight components are non-rectangular.Heavy weight
components are rectangular
 
Is This Answer Correct ?    170 Yes 48 No
G.lakshmi
 
 
 
Answer
# 3
AWT are heavy weight components while Swing are light
weight components
 
Is This Answer Correct ?    135 Yes 18 No
Sanjeev
 
Answer
# 4
AWT are heavy weight components whereas swing is a light
weight component because the swings are not platform
specific.
 
Is This Answer Correct ?    118 Yes 26 No
Tina
 
Answer
# 5
this is vinay
1. swing is light weight component and awt is heavy weight
component.
2. swing components require javax.swing package where as
awt comonents require java.awt package
3. awt requres native code to execute/run but not swings
4. swing are also known as JFC's
5. swing is a look and feel component and it is purely
developed in java.
 
Is This Answer Correct ?    87 Yes 22 No
Vinay
 
Answer
# 6
Most of the issues related to mixing AWT and Swing
components are related to the mixing of so-called
heavyweight and lightweight components. A heavyweight
component is one that is associated with its own native
screen resource (commonly known as a peer). A lightweight
component is one that "borrows" the screen resource of an
ancestor (which means it has no native resource of its
own -- so it's "lighter").

(Lightweight component support was introduced in JDK1.1,
and you can read more about it in the

We generally don't recommend mixing Swing and AWT
components because there are significant benefits in
sticking with programs that are written entirely in Swing
(and thus use only lightweight components).
Some of the benefits of using Swing components are:
More efficient use of resources: Lightweight
components are really "lighter" than heavyweight
components.
More consistency across platforms because Swing is
written entirely in Java.
Cleaner look-and-feel integration: You can give a
set of components a matching look-and-feel by implementing
them using Swing.
Despite the benefits of using Swing components exclusively,
a developer may sometimes have to mix AWT components and
Swing components in the same program (even when migration
is not to blame). For example, such mixing may be required
when a Swing version of a particular AWT component is not
yet available.
Because there's sometimes no alternative to mixing
heavyweight and lightweight components, we have provided a
few options in Swing to make a certain level of component-
mixing possible. However, as anyone who has tried this
approach knows, there are some practical limitations to
this approach

There are some significant differences between lightweight
and heavyweight components. And, since all AWT components
are heavyweight and all Swing components are lightweight
(except for the top-level ones: JWindow, JFrame, JDialog,
and JApplet), these differences become painfully apparent
when you start mixing Swing components with AWT components.
 
Is This Answer Correct ?    82 Yes 22 No
Harivardhan.a
 
Answer
# 7
Main differences:
1. Awt components are heavy weight whereas swing components are light weight, heavy weight are those which are os dependent.

2. A swing has extra components like table,tree,optionalpanel with the class named JTree,JTable,JOptionalPane etc.


3. Swing components support MVC (model,view,control architecture) whereas awt components support Delegate Event Model.

4. Swing components provide dynamic look and feel whereas awt components provide static look and feel.



the awt is the base, its components are heavy weight as they are operating system dependent.To solve this problem we introduce swing
the swing self built components which are not inherited from awt are light weight .Still a major problem with swing
is that the components it inherited from awt are atill heavy this problem is solved by hidden container ContentPane which u can get by method getContentPane()
 
Is This Answer Correct ?    63 Yes 23 No
Java Learner
 
Answer
# 8
The classes contained in the java.awt package provide a
basic capability to create graphical user interfaces, but
the scope of the tools contained in java.awt is limited.
Furthermore, the actual implementation of the components is
done in a language other than Java, and the look and
behavior of the components is somewhat dependent on the
runtime platform's native environment. AWT components might
act slightly differently on a UNIX system than they would on
a PC.

The Swing classes are the next-generation (Java 2) GUI
classes. They provide a number of new components including
trees, tables, and tooltips, etc. Swing components are
written entirely in Java...

You can read more about swing here :
www.roseindia.net/java/example/java/swing/
 
Is This Answer Correct ?    54 Yes 19 No
Hemz
 
Answer
# 9
AWT are heavy weight components in the sense that they are
platform dependent means those features are tied to the
OS.But Swings are light weight components i.e.,they are
platform independent GUI.
 
Is This Answer Correct ?    39 Yes 14 No
Dinesh
 
Answer
# 10
AWT components use native methods whereas Swing components
use the methods that are written in Java.
AWT components are Heavy weight and Swing components are
Light weight.
Awt is not platform independent where as swing is platform
independent
 
Is This Answer Correct ?    39 Yes 15 No
Chamil Dias
 

 
 
 
Other Swing Interview Questions
 
  Question Asked @ Answers
 
What things to do to make a web browser compatibale for swing components? Wipro 1
when we right click on the JTable using mouse it works properly but how to right click on JTable in java using keyboard what should be the code for the same.....? Thanks Nitin   1
How to merging the particular cells in JTable   1
Difference between AWT and Swing compenents?   3
what are the root classes of all classes?   4
How can you draw using Swing components?   1
Default layout for a ContentPane in JFC? HCL 8
how to give transparency for JComboBox,JListBox and JTable TCS 2
What does x mean in javax.swing?   7
Name the borders provided by Swing? Accenture 1
please any one explain this project: Minimizing recovery state in geographic ad hoc routing IBM 1
What is JTable and what is its purpose?   4
 
For more Swing Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com