Here you will learn about difference between AWT and Swing in Java.
在这里,您将了解AWT和Java中的Swing之间的区别。
AWT and Swing both are used to create GUI interface in Java. Both of them are used to perform almost same work, still they differ from each other. In this tutorial I have shared about some differences between AWT and Swing.
AWT和Swing都用于在Java中创建GUI界面。 两者都用来执行几乎相同的工作,但它们仍然彼此不同。 在本教程中,我分享了AWT和Swing之间的一些区别。
Difference between Abstract Class and Interface in JavaJava中抽象类和接口之间的区别
Java中的AWT和Swing之间的区别 (Difference between AWT and Swing in java)
AWT
|
Swing
|
AWT stands for Abstract Window Toolkit.
|
Swing is a part of Java Foundation Class (JFC).
|
AWT components are heavy weight.
|
Swing components are light weight.
|
AWT components are platform dependent so there look and feel changes according to OS.
|
Swing components are platform independent so there look and feel remains constant.
|
AWT components are not very good in look and feel as compared to Swing components. See the button in below image, its look is not good as button created using Swing.
![]() |
Swing components are better in look and feel as compared to AWT. See the button in below image, its look is better than button created using AWT.
|
AWT
|
摇摆
|
AWT代表“抽象窗口工具包”。
|
Swing是Java基础类(JFC)的一部分。
|
AWT组件很重。
|
Swing部件重量轻。
|
AWT组件取决于平台,因此外观和感觉会根据OS进行更改。
|
摆动组件独立于平台,因此外观保持不变。
|
与Swing组件相比,AWT组件在外观和感觉上都不太好。 请参见下图中的按钮,其外观不如使用Swing创建的按钮好。
![]() |
与AWT相比,Swing组件的外观和感觉更好。 请参见下图中的按钮,其外观比使用AWT创建的按钮更好。
|
If you know about any other difference between AWT and Swing than please mention it by commenting below.
如果您不了解AWT和Swing之间的任何其他区别,请在下面评论中提及。
翻译自: https://www.thecrazyprogrammer.com/2015/04/difference-between-awt-and-swing-in-java.html