Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Difference between Swing and AWT

Posted on 2002-05-09
4
Medium Priority
?
527 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
 

Accepted Solution

by:
paintor earned 200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

824 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