I have started studying JAVA and I wanted to know which of these, Java AWT or Java SWING package is the best?
How many of you think Swing is better and can you tell why you feel like that?
But it's been said that AWT is supported many other devices as well and AWT is superior...how many agree to it?
Which is better Java AWT or Java Swing?
Moderator: General Moderators
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
Swing. No two ways about it. That's because Swing is based on AWT is actually an up-dated/graded version of it, in many ways. As it is, it provides more control over your UI, with more flexibility. Check the java.sun.com docs on Swing for reference.
Some comparisons of AWT and Swing:
http://bdn.borland.com/article/0,1410,26970,00.html
http://forum.java.sun.com/thread.jspa?t ... 0&tstart=0
Here's my Google search:
http://www.google.com/search?hl=en&q=AW ... d+to+Swing
Some comparisons of AWT and Swing:
http://bdn.borland.com/article/0,1410,26970,00.html
http://forum.java.sun.com/thread.jspa?t ... 0&tstart=0
Here's my Google search:
http://www.google.com/search?hl=en&q=AW ... d+to+Swing
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
As far as I remember, Swing API was written purely from scratch, not taking any of the existing AWT codebase. The reason was to eliminate the peer latching mechanism that was employed in AWT framework. So, A Button would look different on Mac, Win and UNIX Platforms. Swing has it own Pluggable Look & Feel (PLAF) packages which can gives you uniform look & feel over different OSes. Many other APIs were also coded at that time but none was so swift at it... so none other gained popularity.foobar wrote:That's because Swing is based on AWT is actually an up-dated/graded version of it, in many ways.
I never claimed that Swing was based on AWT code, what I meant is that it's kind of the "next version" of AWT, if you want. It has been sped up, and as you said, now has a unified look & feel across all OS's. However, when programming in Swing, you'll sometimes have to take advantage of AWT classes, which have not been included in Swing. I don't know off the top of my head what they are, but IIRC drawing polygons still uses AWT. Not positive though. I'll look it up. Plus, Swing is more programmer-friendly and not as antiquated as AWT. AWT is ancient.n00b Saibot wrote:As far as I remember, Swing API was written purely from scratch, not taking any of the existing AWT codebase. The reason was to eliminate the peer latching mechanism that was employed in AWT framework. So, A Button would look different on Mac, Win and UNIX Platforms. Swing has it own Pluggable Look & Feel (PLAF) packages which can gives you uniform look & feel over different OSes. Many other APIs were also coded at that time but none was so swift at it... so none other gained popularity.foobar wrote:That's because Swing is based on AWT is actually an up-dated/graded version of it, in many ways.