What is the difference between AWT & Swing?

Answer Posted / java learner

Main differences:
1. Awt components are heavy weight whereas swing components are light weight, heavy weight are those which are os dependent.

2. A swing has extra components like table,tree,optionalpanel with the class named JTree,JTable,JOptionalPane etc.


3. Swing components support MVC (model,view,control architecture) whereas awt components support Delegate Event Model.

4. Swing components provide dynamic look and feel whereas awt components provide static look and feel.



the awt is the base, its components are heavy weight as they are operating system dependent.To solve this problem we introduce swing
the swing self built components which are not inherited from awt are light weight .Still a major problem with swing
is that the components it inherited from awt are atill heavy this problem is solved by hidden container ContentPane which u can get by method getContentPane()

Is This Answer Correct ?    66 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the swing components?

491


What are controls and what are different types of controls in awt?

509


What is swing in java with example?

500


Which method is used for setting security in applets?

583


What is swing and its features in java?

483






What is the role of java swing?

491


What is java swing components?

523


Which window contains the swing controls?

516


Which swing methods are thread-safe?

633


What are the advantages of the event-delegation model over the event-inheritance model?

668


Why should any swing call back implementation execute quickly?

573


Which method is used by the applet to recognize the height and width?

641


what are the steps required in creating an empty table drop?

566


What is swing control in java?

536


Which is better swing or awt?

523