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 Swing Components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing Components" Watch "Swing Components" New topic

Swing Components

kedar parundekar
Ranch Hand

Joined: May 10, 2006
Posts: 40
How AWT components are differ from swing components?
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
I suggest you search on "Swing versus AWT"
marc weber

Joined: Aug 31, 2004
Posts: 11343

Moving to the Swing/AWT forum.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46323
Swing components have their own "look-and-feel," which is derived from Java. They make little use of the underlying OS, which is called "lightweight." Some AWT classes (eg Color) don't have a "look-and-feel" as such, and are therefore not duplicated in Swing. Their inheritance varies, but you will usually find a Swing class has a superclass in AWt somewhere. Those classes in Swing which correspond to AWT classes have the same name with a J prefix.

AWT components are older than the corresponding Swing classes, and they make heavy use of the OS, and are called "heavyweight." They do not have a "look-and-feel" of their own, but "borrow" a "look-and-feel" from the OS.

So: A Swing app using "metal" "look-and-feel" will run on Windows and on a Mac, and ought to look the same.
An AWT app will run on Windows and Mac, but will look different.

I agree. Here's the link:
subject: Swing Components
It's not a secret anymore!