| Author |
Swing Vs AWT
|
Timothy Sam
Ranch Hand
Joined: Sep 18, 2005
Posts: 746
|
|
|
Hi guys! I was having an argument with my friend how Classes in AWT are actually more heavy weight than Swing. I even told him that some classes in the awt package are not entirely written in Java. But I need to give him proof. Do you guys agree? Could you point me to an article? Thanks!
|
SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
|
 |
Tim LeMaster
Ranch Hand
Joined: Aug 31, 2006
Posts: 226
|
|
How about sun themself: http://java.sun.com/products/jfc/reference/faqs/index.html#what_swing http://java.sun.com/products/jfc/tsc/articles/mixing/ "And, since all AWT components are heavyweight and all Swing components are lightweight (except for the top-level ones: JWindow, JFrame, JDialog, and JApplet), these differences become painfully apparent when you start mixing Swing components with AWT components."
|
 |
Edwin Dalorzo
Ranch Hand
Joined: Dec 31, 2004
Posts: 961
|
|
|
Mixing HEAVY weight and light components
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15229
|
|
I even told him that some classes in the awt package are not entirely written in Java. What would they be written in then? AWT classes are all Java. But they call native interfaces. Also note that as of 1.5.0_09 (I think) the statement that Swing components are lightweight (except for top level components) needs to be redefined. When using the native OS Look and Feel, Swing components like JButton, JLabel, JComboBox, etc now make similar native interface calls to the OS for drawing the widgets. I am sure Sun will still maintain these are lightweight, but arguably so. I think what they have done is fixed the "mixing HW and LW components" issue to support native look and feel. But I don't know that for a fact.
|
 |
Timothy Sam
Ranch Hand
Joined: Sep 18, 2005
Posts: 746
|
|
What would they be written in then? AWT classes are all Java. But they call native interfaces.
I'm sure I've read that in a book somewhere... Deitel? Errr... Thanks for the article guys! I'll just read those then.
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15229
|
|
Originally posted by Timothy Sam: Deitel?
Well, that would be the problem.
|
 |
 |
|
|
subject: Swing Vs AWT
|
|
|