Solved

Difference between Swing and AWT

Posted on 2002-05-09
4
515 Views
Last Modified: 2013-12-22
What the difference between Swing and AWT? Please tell me the advantages and disadvantages of both.
0
Comment
Question by:asukai
  • 2
4 Comments
 

Author Comment

by:asukai
ID: 6998311
Also, the situation when one of them is the most suitable.
0
 

Author Comment

by:asukai
ID: 6998316
And what they are
0
 
LVL 2

Expert Comment

by:CSuvendra
ID: 6998338
0
 

Accepted Solution

by:
paintor earned 50 total points
ID: 6998736
Swing is a newer and better API for windowing. The advantages are that it is easier, better constructed and follows the "java look and feel". Programming in swing is easier than the AWT. In all most all application writing situations use Swing. (providing all cleint machines will have a recent enough java virtual machine available. This is most probable

The exception is:

With swing, because it is "newer" many browsers dont support it on the internet. Therefore when writing internet based applications that use pop up windows, or applets on the client side, AWT is used for compatibility reasons, a much wider audience will be able to use and veiw applets written in this fashion since it has been around from the start and java enabled browsers will have AWT funtunality. So use AWT for internet stuff and situations where client machines might have an old Java virtual machine.


NOTE:
There are some third party tools that convert between Swing and AWT, i dont use these since you will get better code from scratch in ether method. Browsers can accept a plugin to display swing if the client machine does not have a recenbt enough java virtual machine, however clients have to install these, or accept the updates and it it seen as bad practice to use swing for online apps. I dont recommend using a tool to convert ether



Hope this answers your queries :-)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now