I am new to swing and i would like to know that how is swing different from that of applet ???
Also how is swing a light weight component and why is it not useful for web applications ???
thanks, Suresh
Henrik Engert
Ranch Hand
Joined: Apr 26, 2005
Posts: 68
posted
0
Google is fantastic
A lightweight component is one that subclasses java.awt.Component (or java.awt.Container) directly - implementing the look-and-feel of the component in Java rather than delegating the look-and-feel to a native peer. Lightweight components can be more efficient at utilizing system resource, they can be transparent, and they do not have to be rectangular (all of which are limitations when working with components that have a peer).
Thanks a lot for your information. I have some more queries ...
Whether all the swing components are subclassing Component or Container ??? Whether there is any life cycle events as we have in applet ???
another question why does applet called a heavy weight component ??? whether it doesnt extends Component or container ???
Thanks, Suresh Babu
Henrik Engert
Ranch Hand
Joined: Apr 26, 2005
Posts: 68
posted
0
JComponent is the base class for all Swing components except top-level containers. JComponent extends Container.
It is all in the Javadoc for Swing.
I found this by searching with Google:
The only heavyweight components used in Swing are:
swing.JFrame swing.JDialog swing.JWindow swing.JApplet All AWT components (awt.*), except those noted below. All other Swing components are lightweight. Swing's lightweight components are:
awt.Component awt.Container swing.JComponent All other Swing classes (swing.*) and all packages under it, except for those noted above.
[ January 30, 2007: Message edited by: Henrik Engert ]