版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、外文原文The Java Abstract Windowing ToolkitFor the past five days you’ve concentrated on creating applets that do very simple things: display text, play an animation or a sound, or enable very basic interactions with the use
2、r. Once you get past that point, however, you may want to start creating more complex applets that behave like real applications, embedded in a Web page—applets that start to look like real GUI applications with buttons,
3、 menus, text fields and other elements of a real application.It’s this sort of real work in Java applets and applications that Java’s Abstract Windowing Toolkit, or AWT, was designed for. You’ve actually been using the A
4、WT all along, as you might have guessed from the classes you’ve been importing. The Applet class and most of the classes you’ve been using this week are all integral parts of the AWT. In fact, the HotJava browser is also
5、 written in Java and uses 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口 Suppo
6、rt for UI “containers,” which can contain other embedded containers or UI widgets口 An event system for managing system and user events between and among parts of the AWT口 Mechanisms for laying out components in a way tha
7、t enables platform-independent UI designToday, you’ll learn about how to use all these things in your Java applets. Tomorrow, you’ll learn about creating windows, menus, and dialogs, which enable you to pop up separate w
8、indows from the browser window. In addition, you can use the AWT in stand-alone applications, so everything you’ve learned so far this week can still be used. If you find the framework of the Web browser too limiting, yo
9、u can take your AWT background and start writing full-fledged Java applications.Today, however, you’ll continue focusing on applets.Note: This is by far the most complex lesson so far. There’s a lot to cover and a lotof
10、code to go through today, so if it starts becoming overwhelming, you mightwant to take two days (or more) for this one.An AWT OverviewThe basic idea behind the AWT is that a Java window is a set of nested components, sta
11、rting from the outermost window all the way down to the smallest UI component. Components can class hierarchy that makes up the main classes in the AWT. The root of most of the AWT components is the class Component, whic
12、h provides basic display and event handling features. The classes Container, Canvas, TextComponent, and many of the other UI components inherit from Component. Inheriting from the Container class are objects that can con
13、tain other AWT components—the Panel and Window classes, in particular. Note that the java.applet.Applet class, even though it lives in its own package, inherits from Panel, so your applets are an integral part of the hie
14、rarchy of components in the AWT system.Figure 13.2.A partial AWT class hierarchy.A graphical user interface-based application that you write by using the AWT can be as complex as you like, with dozens of nested container
15、s and components inside each other. AWT was designed so that each component can play its part in the overall AWT system without needing to duplicate or keep track of the behavior of other parts in the system.The Basic Us
16、er Interface ComponentsThe simplest form of AWT component is the basic UI component. You can create and add these to your applet without needing to know anything about creating containers or panels—your applet, even befo
17、re you start painting and drawing and handling events, is already an AWT container.Because an applet is a container, you can put other AWT components—such as UIcomponents or other containers—into it.In this section, you’
18、ll learn about the basic UI components: labels, buttons, checkboxes, choice menus, and text fields. In each case, the procedure for creating the component is the same—you first create the component, and then add it to th
19、e panel that holds it, at which point it is displayed on the screen. To add a component to a panel (such as your applet, for example), use the add() method:public void init() {Button b = new Button(“OK”);add(b);}Componen
溫馨提示
- 1. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫(kù)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- java工具包
- 計(jì)算機(jī)專業(yè) java外文翻譯
- 使用谷歌翻譯工具包
- java利用jxl工具包操作excel文件
- 計(jì)算機(jī)外文翻譯--java編程語(yǔ)言的介紹
- 計(jì)算機(jī)外文翻譯---java技術(shù)與ssh框架
- 計(jì)算機(jī)專業(yè)英語(yǔ)java介紹外文翻譯
- 計(jì)算機(jī)專業(yè)外文翻譯--計(jì)算機(jī)
- 計(jì)算機(jī)外文翻譯--菜單和工具欄
- 計(jì)算機(jī)外文翻譯---計(jì)算機(jī)引論
- 計(jì)算機(jī)科學(xué)與技術(shù)外文翻譯--詳細(xì)解析java中抽象類和接口的區(qū)別
- [雙語(yǔ)翻譯]--計(jì)算機(jī)外文翻譯---安全型java servlet的開發(fā)
- 招聘技術(shù)工具包
- 計(jì)算機(jī)畢業(yè)設(shè)計(jì)外文翻譯--現(xiàn)代并發(fā)抽象c#
- [雙語(yǔ)翻譯]計(jì)算機(jī)專業(yè)外文翻譯—云計(jì)算中的java web部署
- 工具winaircrackpack工具包使用介紹
- 計(jì)算機(jī)外文翻譯
- 計(jì)算機(jī)外文翻譯---j2me和java領(lǐng)域
- 計(jì)算機(jī)類外文文獻(xiàn)翻譯---java核心技術(shù)
- 黑客工具包大全
評(píng)論
0/150
提交評(píng)論