Use SWT in Eclipse for interface design

Source: Internet
Author: User
Using SWT in Eclipse for interface design SWT is a cross-platform GUI development kit developed by IBM. As for why IBM is struggling to develop another GUI toolkit, rather than using Sun's existing Java GUI framework consisting of AWT, Swing, Java 2D, and Java 3D, it's a long time to say. (Remember to read a joke about the origins of SWT on a BBS ). 1. Why use SWT? SWT is a cross-platform GUI development kit developed by IBM. As for why IBM is struggling to develop another GUI toolkit, rather than using Sun's existing Java GUI framework consisting of AWT, Swing, Java 2D, and Java 3D, it's a long time to say. (Remember to read a joke about the origins of SWT on a BBS ).
Before SWT, Sun has provided a cross-platform GUI development kit AWT (Abstract drawing wing Toolkit ). although the AWT framework uses native widgets, it has never broken through the LCD problem. LCD problems lead to loss of some major platform features. In other words, if Platform A has A widget (widgets) ranging from 1 to 40, and Platform B has A widget (widgets) 20-25, the cross-platform AWT framework can only provide the intersection of these two parts.
To solve this problem, Sun has created a new framework. Instead of using native widgets, this framework uses emulated widgets ). Although this method solves the LCD problem and provides a rich set of window components, it also brings new problems. For example, the interface appearance of a Swing application is no longer similar to that of a native application.
Although these Swing applications have achieved the maximum performance improvement in JVM, they still have performance problems that their native counterparts do not have. In addition, Swing applications consume too much memory, so Swing is not suitable for small devices, such as PDAs and mobile phones.
IBM has tried to completely solve the aforementioned problems brought about by AWT and Swing frameworks. Finally, IBM created a new GUI library, which is SWT. The SWT framework uses JNI to access native widgets. If a widget cannot be found on the host platform, SWT automatically simulates it.
2. the basic components of a SWT application are the Display, Shell, and Widgets ). Display manages the event loop and controls the communication between the UI thread and other threads. Shell is a window managed by the operating system window manager in an application. Each SWT application requires at least one Display and Shell instance greater than or equal to one.
Figure 1: SWT applications from different perspectives Figure 1 shows SWT applications from different perspectives. The graph on the left is an inherited graph of a simplified UI object. The middle graph shows the container structure of the UI object ). The figure on the right is the UI appearance after creation.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.