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 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" Watch "swing" New topic


sampurna Rao

Joined: Jan 20, 2003
Posts: 6
What is swing basically? how it is differ from awt?
sravan kumar

Joined: Sep 13, 2000
Posts: 5
Originally posted by sampurna:
What is swing basically? how it is differ from awt?
A swing is a Lightweight component where as an awt is a heavy
weight component. what is this light weight component and heavy
weight component. i will give you a simple example with this i
hope you will be expertise.
if you develop a simple frame with user name and password as a
fields in the frame when you compile and run the programs your
will get some out put say hai etc. but what the thing here is
that when you run the same frame in windows the look and feel
will be different and on unix it will be different and motiff it
will be defferent i.e the text fields will look different omn
different operating systems.

alexander Petrovich

Joined: Jul 31, 2000
Posts: 12
I would like to add smth. more to the last message.
"Heavyweight" means that component is not written in pure java and uses native to current OS code. Swing generally consist of "lightweight" components, written in Java only.
But still extends AWT adn container classes, for example JFrame has a native code. and Applet class also..
It is not good practice to mix different components in one application. For example labels can be sometime visible on many tabs instead of one and so on...
alex from
daily tips and advices
Dipu Krishnankutty

Joined: Oct 16, 2000
Posts: 10
Ur suggestion that "heavy weight components r developed in native os",but i think all the java packages r written in java itself.only the jvm(interpreter) is written in c++.
I agree. Here's the link:
subject: swing
It's not a secret anymore!