What is the difference between AWT and Swing? - ProProfs Discuss
Advertisement

What is the difference between AWT and Swing?

What is the difference between AWT and Swing?

Change Image    Delete

Asked by Demi , Last updated: Nov 10, 2024

+ Answer
Request
Question menu
Vote up Vote down

3 Answers

J. Lautner

J. Lautner

J. Lautner
J. Lautner, Product Manager, Utah

Answered Jul 28, 2020

AWT or Abstract Window Toolkit and swing are two components of GUI (Graphical User Interface). One of the major differences between AWT and swing is that; while the former uses native commands on the platform, the latter uses Java codes. Although in the case of AWT, the use of native commands also adds to its speed, these commands can't be used on other platforms unless the counterpart commands are changed.

While both strive to look exactly like the operating system they are running on, AWT has a greater advantage overswing in this aspect since it uses native commands. However, it is important to note that there are more features in the swing than in AWT.

For instance, features like icons and tooltips are absent in AWT but present in the swing. Another difference is that AWT is used mostly when creating simple Java applets, whereas swing is a better choice for sophisticated apps.

upvote downvote
Reply 

S. Hughes

S. Hughes

S. Hughes
S. Hughes

Answered Jul 23, 2020

Java programming includes a number of toolkits that the user can choose from. Two of those kits include AWT and Swing. AWT stands for Abstract Window Toolkit. This toolkit uses a lot of the commands that Java has always had, which in turn gives the toolkit a fast speed.

This toolkit may need to be converted so that when it is on other platforms it can be used. Compared to AWT, Swing is more portable, but it has an average speed and performance. Along with that, Swing tends to try to convert to the operating system that it is being ran on.

upvote downvote
Reply 

J. Alfie

J. Alfie

I Write for myself and many other clients. Blog post, Article writing and writing for ProProfs is my daily thing.

J. Alfie
J. Alfie, Content Writer, Masters in Literature, Dallas,Texas

Answered Jul 13, 2020

AWT or Abstract Window Toolkit and swing are two different toolkits that are majorly used in Java programming. These toolkits have some differences which determine the role they play when it comes to programming. The AWT makes use of lot of the platform's native commands which in turn leads to a very high speed.

But you may need to change the counterpart command so as to convert it to be usable on other platforms. On the other hand, swing makes use of pure Java code which makes it so portable to be used on platforms at its average performance and speed. Swing also attempts to emulate the look of the OS it is running on, thus resembling the native environment.

The AWT is of an advantage here, since it makes use of the native commands, and looks exactly like the native UI. Actually, one major pro of swing over AWT is that it supports much more future.

upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.