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

How does the garbage collector works in java?

0 Answers   Cyient,


What is constructor and virtual function? Can we call a virtual function in a constructor?

0 Answers  


Why java uses the concept of the string literal?

0 Answers  


How to convert string to byte array and vice versa?

0 Answers  


How do you ensure that n threads can access n resources without deadlock?

0 Answers  






I want to persist data of objects for later use. What is the best approach to do so?

0 Answers  


Can a static member function access member variable of an object?

0 Answers   Virtusa,


Can a final variable be initialized in constructor?

0 Answers  


Can I override protected method in java?

0 Answers  


can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread

0 Answers  


What is a module function?

0 Answers  


What is instance means in java?

0 Answers  


Categories