Categories: Uncategorized

Difference Between AWT and Swing

Programming in the Java language has really started to take off simply because of its ability to port programs across multiple platforms. This is not only true for desktop computers, but Java is also present on Pocket PCs and even standard mobile phones. Because of this, there are already many people who want to program in the Java language to take advantage of this large and growing market.

Programming in Java means that you must have the right tools to finish your project quickly and efficiently. One of the essential tools is the GUI (Graphical User Interface) component. This allows you to easily add graphical components without much of the programming required. In this category, there are two that you can choose from. The first is the AWT (Abstract Window Toolkit) and the second is the swing, which appeared much later.

Both of these toolkits have their own advantages and disadvantages that make them suitable for different types of programming needs. The AWT uses many of the platform’s native commands which lend it a great deal of speed. But to convert it for use on other platforms, you need to change the counterpart commands. Swing, on the other hand, uses pure Java code, which makes it very portable across platforms at the cost of speed and performance.

Another feature of swing is that it tries to emulate the look and feel of the operating system it is running on, so it resembles the native environment. This is overcome by AWT as it uses native commands; It looks exactly like the native UI looks. One of the main advantages of swing is that it supports many more features than AWT. Components like tooltips and icons are not available in AWT, while they can be fully used in swing. However, swing’s added features and pure java design means you would need the java plugin for the program to run, whereas most current browsers already support AWT classes which eliminates the need for plugin downloads.

To summarize, if you want to create simple Java applets, you may find AWT’s quick and easy build methods to be of great help. But if you want to create a complete application, you can see what swing can offer you. Improved component list and portability could be more useful.

Mohammad Asif Goraya

M A Goraya has qualification of M.phil in Agricultural Sciences. He has almost 15 years of teaching Experience at college and university level. He likes to share his research based knowledge with his students and audience.

Recent Posts

Difference Between Summary and Conclusion with Proper Definition and Brief Explanation

Main Difference - Summary vs Conclusion Summary and conclusion are two terms that are often…

1 year ago

Difference between Moth and Butterfly

Difference between moth and butterfly fall into two categories: anatomical and behavioral. Most moths are…

1 year ago

Difference Between Architect and Engineer

An engineer is a person whose job is to design and build engines, machines, roads,…

2 years ago

Difference between the Internet and the World Wide Web

Internet is the term used to identify the massive interconnection of computer networks around the…

2 years ago

Difference Between CD-R and CD-RW

A CD-R is a type of disc that does not contain any data. It is blank…

2 years ago

Difference between x86 and x64

Computing technologies are constantly evolving, and if we base our predictions on Moore's Law, they…

2 years ago