⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 13.htm

📁 翁剀JAVA语言那门课程的教案 很多人都看多他的视频教程可惜没有ppt的教案
💻 HTM
字号:
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="Weng Kai">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
   <TITLE>The new AWT</TITLE>
</HEAD>
<BODY>

<H1>
13. The new AWT</H1>

<HR WIDTH="100%">
<BR>In Java 1.1 a dramatic change has been accomplished in the creation
of the new AWT. Most of this change revolves around the new event model
used in Java 1.1: as bad, awkward, and non-object-oriented as the old event
model was, the new event model is possibly the most elegant I have seen.
It's difficult to understand how such a bad design (the old AWT) and such
a good one (the new event model) could come out of the same group. This
new way of thinking about events seems to drop so easily into your mind
that the issue no longer becomes an impediment; instead, it's a tool that
helps you design the system. It's also essential for Java Beans, described
later in the chapter.

<P>Instead of the non-object-oriented cascaded if statements in the old
AWT, the new approach designates objects as "sources" and "listeners" of
events. As you will see, the use of inner classes is integral to the object-oriented
nature of the new event model. In addition, events are now represented
in a class hierarchy instead of a single class, and you can create your
own event types.

<P>You'll also find, if you've programmed with the old AWT, that Java 1.1
has made a number of what might seem like gratuitous name changes. For
example, setSize( ) replaces resize( ). This will make sense when you learn
about Java Beans, because Beans use a particular naming convention. The
names had to be modified to make the standard AWT components into Beans.

<P>Java 1.1 continues to support the old AWT to ensure backward compatibility
with existing programs. Without fully admitting disaster, the online documents
for Java 1.1 list all the problems involved with programming the old AWT
and describe how those problems are addressed in the new AWT.

<P>Clipboard operations are supported in 1.1, although drag-and-drop "will
be supported in a future release." You can access the desktop color scheme so your Java
program can fit in
with the rest of the desktop. Pop-up menus are available, and there
are some improvements
for graphics and images. Mouseless operation is supported. There is
a simple API for printing
and simplified support for scrolling.
<HR WIDTH="100%">
<DIV ALIGN=right><A HREF="13_1.htm">Next Page</A></DIV>

</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -