Solved

Difference between Swing and AWT

Posted on 2002-05-09
4
522 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java string replace 11 79
Html Table Looping (part 2) 5 42
How to log java errors in tomcat 8 39
Eclipse neon2 "Java build path" correctness 7 44
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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 one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

752 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