Java Swing AWT Question:

Explain the difference between swing and AWT?

Tweet Share WhatsApp

Answer:

• AWT is a heavyweight component that is used to associate the language with the native component. Whereas, Swing is the lightweight component that doesn't associate, any language with the component that it uses.
• AWT draws the own component on the screen and it uses their own view-port that sends the output to the screen that displays the result. Whereas, Swing doesn't include any writing option to show the result on the screen so it does redirect to the components that makes it.
• AWT components are of the z-ordering and it is not possible to combine any other in the same container. Whereas, Swing doesn't include the z-ordering and it always come below the AWT.
• AWT is less consistent when used on different platforms. Whereas, Swing is more consistent across different platforms.

Download Swing AWT PDF Read All 29 Swing AWT Questions
Previous QuestionNext Question
Explain the use of JFC in Java Swing?Explain the function of lightweight Components used in Swing?