Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between Swing and SWT

2025-03-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces what is the difference between Swing and SWT, the article is very detailed, has a certain reference value, interested friends must read it!

In short, the advantages of Swing over SWT are: high speed, skin mechanism support, excellent framework, flexible scalability, official standards, 47% market share, rich third-party class libraries, countless learning materials, and powerful free graphical interface design tools (NetBeans Matisse). Compared with SWT, there are some disadvantages: more than 10m memory consumption, slow startup speed, and relatively weak desktop integration. Both have a beautiful localized appearance.

From the two original design goals, SWT is a temporary cure, the purpose is to improve the speed, improve the appearance; Swing is the root of the problem, it starts from the framework, structure. Therefore, Swing has a broader space for development than SWT. Because of its excellent architecture and complete control over the implementation of Java, Swing can always be improved. When Swing matures to make up for speed and appearance, the development of Swing presents a broad sky because of its good architecture, code control and other factors. Since the birth of SWT, its congenital architecture and implementation defects have determined that it is difficult to move forward. Because of its reliance on the local operating system, SWT has little room to grow. At first, you may be able to achieve good results quickly with the help of the native implementation of the operating system, but this is the end, and there is little room for you to optimize the reverse development. It gives most of its implementation to heterogeneous systems, systems that it cannot control, but systems that cost a lot of money to interact with.

SWT is faster to get started. Because SWT's API is similar to traditional GUI tools, this makes it easy for many programmers to switch from traditional GUI tools. The traditional GUI tool system, especially the Windows platform, is based on message mapping mechanism, and its basic model is process-oriented and message-oriented. The design idea of Swing is based on the model of object-oriented, and its MVC pattern is the classic of programming pattern. Generally speaking, Swing and SWT are like object-oriented languages to process-oriented languages. But in terms of the learning curve, Swing is no steeper than SWT. Swing itself is very mature, official documents, a variety of online materials, books, discussion areas are numerous, in fact, the learning curve may not be steeper than SWT.

In terms of the development experience of Swing and SWT, the experience that SWT gives developers is that the satisfaction with SWT is inversely proportional to the time it takes to use SWT, and inversely proportional to the understanding of SWT and Swing. At the beginning, it is often very satisfied, and even has an amazing feeling. But with the increase of usage time and the deeper understanding of SWT, this satisfaction will decline more and more. In short, the degree of love is inversely proportional to the degree of understanding. The experience of Swing for developers is. At first you may have to complain a lot, which is like complaining about a weather-beaten person who looks plain but actually has a lot of meaning. As you learn more about it, you will be more and more attracted to it, and eventually you will be amazed at its breadth and depth. You will find that the more you learn, the less you know, while your knowledge and abilities are getting deeper and deeper like internal forces. In short, the degree of love is proportional to the degree of understanding.

To me, the story between Swing and SWT is like the story between a train and a carriage: when the train was first invented, many people laughed at it for being too slow and ugly. During the train's first test run, people raced in gorgeous carriages and trains, which easily overtook the train. So people are laughing at this ugly, bulky and slow guy, but they don't see the nature and potential of the train. Hundreds of years later, the speed of the train has exceeded 100 kilometers, the transport capacity has reached thousands of tons, the train has become the main force of traffic, while the carriage is still hovering in the beginning. Why? Just because the essential structure of the train is good; because the train has a lot of room for improvement; because the goal at the beginning of the train design is ambitious, not to be satisfied by carrying a few hundred jin of things, but to lay the infrastructure for higher speed and greater capacity.

The above is all the content of the article "what's the difference between Swing and SWT". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report