what is the difference between AWT and SWING what is the
advantage of using swing?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Explain the difference between scrollbar and scrollpane?
What is the difference between array and arraylist? what is the difference between arraylist and linkedlist?
How to make a write-only class in java?
What do you understand by casting in java language?
what is the significance of listiterator in java?
What is the use of static import ?
How do you make an arraylist empty in java?
Explain wait(), notify() and notifyall() methods of object class ?
What is meant by final class?
A abstract class extending an abstract class.Super class has both abstract and non-abstract methods.How can we implement abstract and non-abstract mehtods? Explain with snippet
1) There are 10 different threads in runnable state. Each having priority 1 to 10. How does the CPU schedules or executes these threads?
How many types of constructors are used in java?