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 A newbie to MVC Architecture,components in JFC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "A newbie to MVC Architecture,components in JFC" Watch "A newbie to MVC Architecture,components in JFC" New topic

A newbie to MVC Architecture,components in JFC

mara thamizhan
Ranch Hand

Joined: Jul 05, 2006
Posts: 74
Hi all,

I read that swing components are lightweight components as compared to heavyweight components of AWT.

What are components in AWT & SWING ? Is it refers to the java classes?

What is a lightweight component & a heavy weight component!

What is the difference b/w them?

What things can we do in Swing which we cannot do Using Swing Components?

can i Know abt MVC Architecture( which is used consistently througthout the Swing component set)?

Also is it true that AWT components are platform dependent whereas Swing Components are platform independent!
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46337
I can answer a few of your questions; I shall leave people with more time to answer about MVC. I would have thought most of your answers will be in a standard Java book . . .

The Swing classes are newer than the awt (=Abstract Windowing Toolkit) classes; awt classes mostly live in the java.awt package and Swing in the javax.swing package. A few awt classes (eg BorderLayout, Color) are used unchanged by Swing. If there is a Swing class with similar functionality to an awt class, they have the same name with the Swing class having a J prefix. So you can look for Button or JButton. I think Swing was introduced in J1.2, am not certain.

What they mean by "heavyweight" (ie most awt classes) is that they "borrow" the operating system's display mechanisms, so a Frame on Windows looks like any other Windows Frame, but the same program on a Mac will look just like any Mac window, etc.
Swing classes use their own look-and-feel (most people leave the default, which is called "Metal", unchanged), so they are supposed to look the same on any OS; not using the OS mechanics is called "lightweight."

And that's all you're getting from me CR
I agree. Here's the link:
subject: A newbie to MVC Architecture,components in JFC
It's not a secret anymore!