• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I'm being asked to answer this but I'm not why Swing allows a programmer to ignore the AWT.
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic