Chapter 1 Section 2 AWT

Source: Internet
Author: User
Document directory

Returned directory

 

In the introduction to Java, the most exciting part is the applet. The program uses the New Technology of Applet, which can be distributed over the network and executed on the browser. Both users and developers welcome this new feature because it simplifies cross-platform development, release, and maintenance-originally very challenging for commercial software development.

To simplify the development of Java GUI, Sun initially developed a set of distinctive graphics libraries that are unique to Java (look and feel) on all platforms ). Netscape, the main technical partner of Applet, believes that the applet should maintain the look and feel of the runtime system. They hope that the applet can look and act like other programs on the platform it runs. Netscape's attitude has been changing, while sun gave up its Java look [1].

To achieve Netscape's "Local look and feel" goal [2], AWT was created at the final development stage of the first JDK (Java Development Kit) version. AWT uses a "peer" mechanism by default, that is, each GUI control has a corresponding component at the underlying layer of the system.

For example, each Java. AWT. Button Object (the AWT button) will create a corresponding button in the underlying Windows system. When you click the button, the event will be transmitted from the local implementation Library to the JVM (Java Virtual Machine), and finally to the logic associated with the java. AWT. Button Object ). The implementation of the peer-to-peer system and the implementation of interaction between Java components and peer-to-peer components are hidden in the underlying JVM implementation. Therefore, language-level Java code (Java-level code) still supports cross-platform.

However, to comply with the promise of "write once, run anywhere", Java had to adopt some compromise and compromise measures. Specifically, Java adopts the "maximum common number [3]" method, that is, AWT only provides features common to all window systems. To achieve advanced features (like tree view), developers need to develop their own advanced window controls, leaving users with a variety of experiences.

Other problems also slowed down the acceptance of the applet. The applet runs in a secure "sandbox" and prevents malicious applet from abusing file systems, network connections, and other resources. Although the sandbox provides security, it "caws" applications.

After all, what are the benefits of an application that cannot connect to the network or save files? Java GUI applications cannot respond as quickly as local programs. This is partly due to the current hardware performance and the way Java interpreters work.

Therefore, applications developed with AWT lack many features of popular GUI programs and cannot be consistent with those developed with local window libraries in terms of appearance and behavior. There should be a better library to make Java GUI a success.

[1] original note: eclipse.org Press Release, "eclipse.org consorsponforms to deliver new era application development tools," http://www.eclipse.org/org/pr.html.

[2]: a plug-in mainly used for testing.

[3] Translation: Unfortunately, the translator did not find this plug-in on the network.

 

Returned directory

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.