aspose file tools*
The moose likes Beginning Java and the fly likes Why does Swing allows Java programmers to ignore the package Abstract Windowing Toolkit (AWT)? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Why does Swing allows Java programmers to ignore the package Abstract Windowing Toolkit (AWT)?" Watch "Why does Swing allows Java programmers to ignore the package Abstract Windowing Toolkit (AWT)?" New topic
Author

Why does Swing allows Java programmers to ignore the package Abstract Windowing Toolkit (AWT)?

kenny gill
Ranch Hand

Joined: Mar 12, 2012
Posts: 54

I'm being asked to answer this but I'm not why Swing allows a programmer to ignore the AWT.
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2864
    
  11

AWT was the original GUI package of Java. It took the approach of putting wrappers around the native GUI widgets of whatever OS the Java application was running on. This approach had some problems. The native widgets could be different sizes and shapes on different OSes, so it was hard to Write Once Run Everywhere without Testing Everywhere to see if the widgets laid out right on each platform. Also, a similar widget might have different capabilities on different OSes, so AWT could only use features that were common across all the OSes.

To answer these issues, Java introduced a completely different GUI package, and that's Swing. Swing created painted its own widgets, so it has a lot more flexibility than AWT. On the other hand, it has performance issues as can be a bit clunky to use, especially for a beginner. The Swing widgets replace the AWT widgets. While it's not entirely impossible to combine the two, I remember that causing some rendering problems, like buttons appear underneath their panel. Mostly if you use Swing, you stick entirely to the Swing components and don't use the AWT ones at all. There are a few AWT classes that still get used though, like java.awt.Color.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why does Swing allows Java programmers to ignore the package Abstract Windowing Toolkit (AWT)?