what is the difference between AWT and SWING what is the
advantage of using swing?

Answers were Sorted based on User's Feedback



what is the difference between AWT and SWING what is the advantage of using swing?..

Answer / srinivasan.c

Mainly AWT is platform dependent and swings are platform
independent.For example an interface designed in awt will
give different sizes and layouts of elements based upon the
platform.But swings will give same outputs,this is the
reason why the j2ee deploytool is designed in swings and the
setup files of j2ee are designed in swings

Is This Answer Correct ?    17 Yes 5 No

what is the difference between AWT and SWING what is the advantage of using swing?..

Answer / muffy.jad@gmail.com

Swing is a more powerful alternative for awt.Swing is a set
of classes that provides more powerful and flexible
components than awt.In addition to components like
buttons,check boxes and labels they also provide additions
such as tabbed panes,scroll panes and tables.


The main difference between awt and swing is that swing
components are not implemented by platform-specific code,
instead they are written entirely in Java and therefore are
platform-independent.

swing includes more graphic components then awt.Ritesh sharma

AWT - Heavy weight component.
it will invoke native methods.
awt has main() method.

SWING - Light weight component.
It doesn't invoke native methods.
swing has not main()

Is This Answer Correct ?    13 Yes 2 No

what is the difference between AWT and SWING what is the advantage of using swing?..

Answer / modi[achir communication]

Difference between AWT and SWING:

Swing provides a richer set of components than AWT. They are
100% Java-based. There are a few other
advantages to Swing over AWT:
• Swing provides both additional components like JTable,
JTree etc and added functionality to AWT-replacement
components.
• Swing components can change their appearance based on the
current “look and feel” library that’s being used.
• Swing components follow the Model-View-Controller (MVC)
paradigm, and thus can provide a much more
flexible UI.
• Swing provides “extras” for components, such as: icons on
many components, decorative borders for
components, tool tips for components etc.
• Swing components are lightweight (less resource intensive
than AWT).
Java
45
• Swing provides built-in double buffering (which means an
off-screen buffer [image] is used during drawing
and then the resulting bits are copied onto the screen. The
resulting image is smoother, less flicker and quicker
than drawing directly on the screen).
• Swing provides paint debugging support for when you build
your own component i.e.-slow motion rendering.

Is This Answer Correct ?    6 Yes 2 No

Post New Answer

More Core Java Interview Questions

What is pre increment and post increment in java?

0 Answers  


What is the covariant return type?

0 Answers  


I declared main() method as private. But it still running and displaying the output. Please Answer it . Code Snippet as Below: import java.io.*; class over { private static void main(String[] args) { int high = Integer.MAX_VALUE; int overflow = high + 1; int low = Integer.MIN_VALUE; int underflow = low - 1; System.out.println(high + "\n" +overflow +"\n"+ low +"\n"+underflow); //System.out.println(overflow); //System.out.println(low); //System.out.println(underflow); } }

4 Answers   Cap Gemini,


what is default layout of JFrame class?

6 Answers  


What is final keyword in java?

0 Answers  






relation between list and linked list

1 Answers   Infosys,


Where is const variable stored?

0 Answers  


Can we store variables in local blocks?

0 Answers   Global Logic,


What is an object’s lock and which object’s have locks?

0 Answers  


Can one thread block the other thread?

0 Answers  


Is there any difference between nested classes and inner classes?

0 Answers  


how to handle http request in struts

2 Answers   Polaris,


Categories