ALLInterview.com :: Home Page KalAajKal.com
 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   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Java J2EE  >>  Java Related  >>  Swing
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
What is the difference between AWT & Swing?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference between AWT & Swing?
Answer
# 1
AWT are heavy weight components while Swing are light 
weight components.
 
Is This Answer Correct ?    9 Yes 0 No
Guest
 
  Re: What is the difference between AWT & Swing?
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 ?    4 Yes 1 No
G.lakshmi
 
 
 
  Re: What is the difference between AWT & Swing?
Answer
# 3
AWT are heavy weight components while Swing are light 
weight components
 
Is This Answer Correct ?    3 Yes 0 No
Sanjeev
 
  Re: What is the difference between AWT & Swing?
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 ?    3 Yes 1 No
Tina
 
  Re: What is the difference between AWT & Swing?
Answer
# 5
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 ?    2 Yes 1 No
Harivardhan.a
 
  Re: What is the difference between AWT & Swing?
Answer
# 6
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 ?    3 Yes 0 No
Hemz
 

 
 
 
Other Swing Interview Questions
 
  Question Asked @ Answers
 
How to merging the particular cells in JTable  1
Default layout for a ContentPane in JFC? HCL4
How can you draw using Swing components?  1
What is the difference between AWT & Swing? Deshaw6
How are Swing and AWT be differentiated? Wipro2
Difference between ligt weight and heavy weight?  2
What is meant by JFC? Mindlogicx5
what is the diff's between swing and applet? Patni7
what is difference between checked and unchecked exception plz explain examples ? Fujitsu2
what do u mean by GUI framework  1
What does x mean in javax.swing?  2
Difference between AWT and Swing compenents?  1
Does Swing contains any heavy weight component?  3
Explain the differences between an applet and a Japplet?  1
What is the default look and feel of a Swing Component?  1
how can u handle runtime exceptions in java plz explain with examples briefly? Fujitsu2
when i run Frame program, it display output in supparate window.i try to close using "X" it not close.min'-' & max'+' are working.pls what is problem? i run in editplus. folowing program i given. import java.awt.*; class Form1 { Frame f1=new Frame("loginpage"); Label l1=new Label("username"); Label l2=new Label("password"); TextField tf1=new TextField(); TextField tf2=new TextField(); Button b1=new Button("submit"); Form1() { f1.setLayout(new FlowLayout()); f1.add(l1); f1.add(tf1); f1.add(l2); f1.add(tf2); f1.add(b1); f1.setSize(437,440); f1.setVisible(true); //f1.dispose(); } public static void main(String[] args) { Form1 f=new Form1(); } }  4
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 give transparency for JComboBox,JListBox and JTable  1
What are all the components used in Swing?  1
 
For more Swing Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com