File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes What does this mean? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "What does this mean?" Watch "What does this mean?" New topic

What does this mean?

Brian Smith
Ranch Hand

Joined: Oct 26, 2002
Posts: 232
hi all,
I found the following as an introductory definition of AWT:
AWT components match exactly the form of corresponding components in
the operating system, so their appearance is platform dependent.

I am wondering how do AWT components match exactly the form of corresponding components in the operating system? is that the OS contains AWT-like components? could you please explain me this?
I also found this:
An important difference between Swing and AWT is that Swing creates its components using "Pluggable Look & Feel" (PLAF) modules that do not use native code.

What does "modules that do not use native code" mean?
[ August 24, 2003: Message edited by: Namaste Sathi ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Basically, the difference is that AWT makes calls to native GUI components to the OS. So in some DLL or .SO file somewhere, there is a drawing definition for a Button that the OS uses to draw it's Buttons. AWT makes these same calls to the OS to draw Buttons for the AWT. This makes AWT a bit faster that SWING but also limits your components to that which the OS provides for you. It also causes your applications to look different on different OS's.
SWING draws all it's own components using the PLAF which uses the Graphics2D API. So instead of the OS drawing the Button, SWING actually draws it's own. This also makes swing a bit slower than AWT but the tradeoff is well worth the loss in performance. With SWING components, you aren't limited to that which the OS provides. This also makes it possible to create custom components which is pretty much what the entire SWING API is. Also, your applications will look the same on every platform.
Does this help?

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: What does this mean?
It's not a secret anymore!