1、 外文原文 The Java Abstract Windowing Toolkit For the past five days youve concentrated on creating applets that do very simple things: display text, play an animation or a sound, or enable very basic interactions with the user. Once you get past that point, however, you may want to start creating more
2、complex applets that behave like real applications, embedded in a Web pageapplets that start to look like real GUI applications with buttons, menus, text fields and other elements of a real application. Its this sort of real work in Java applets and applications that Javas Abstract Windowing Toolkit
3、, or AWT, was designed for. Youve actually been using the AWT all along, as you might have guessed from the classes youve been importing. The Applet class and most of the classes youve been using this week are all integral parts of the AWT. In fact, the HotJava browser is also written in Java and us
4、es the AWT as well. The AWT provides the following: 口 A full set of UI widgets and other components, including windows, menus, buttons, checkboxes, text fields, scrollbars, and scrolling lists 口 Support for UI “containers,” which can contain other embedded containers or UI widgets 口 An event system
5、for managing system and user events between and among parts of the AWT 口 Mechanisms for laying out components in a way that enables platform-independent UI design Today, youll learn about how to use all these things in your Java applets. Tomorrow, youll learn about creating windows, menus, and dialo
6、gs, which enable you to pop up separate windows from the browser window. In addition, you can use the AWT in stand-alone applications, so everything youve learned so far this week can still be used. If you find the framework of the Web browser too limiting, you can take your AWT background and start writing full-fledged Java applications. Today, however, youll continue focusing on applets. Note: This is by far the most complex lesson so far. Theres a lot to cover and a lot of code to