Java Reference
In-Depth Information
ThissectionintroducesyoutoAWTbyfirstpresentingtoolkits.Itthenexplorescom-
ponents,containers,layoutmanagers,andevents.Afterexploringgraphics,colors,and
fonts, the section focuses on images. It closes by discussing AWT's support for data
transfer.
AWT HISTORY
Before JDK 1.0's release (on January 23, 1996), developers at Sun Microsystems
were tasked with abstracting the various windowing systems of the day and their
attendant widgets (GUI controls, such as buttons—Java refers to GUI controls as
components ) into a portable windowing system that Java applications could target.
AWT was born and was included in JDK 1.0. (Legend has it [see ht-
tp://www.cs.jhu.edu/~scott/oos/java/doc/TIJ3/html/
TIJ316.htm ,forexample]thatthefirstAWTversionhadtobedesignedandim-
plemented in one month.)
TheJDK1.0.1and1.0.2releasescorrectedvariousAWTbugs,andJDK1.1offered
animprovedevent-handlingmodelthatgreatlysimplifiedhowapplicationsrespond
to GUI events (such as button clicks and key presses). Subsequent JDK releases
broughtaboutadditionalimprovements.Forexample,JDK1.2introducedJFC,JDK
6 introduced the Desktop, Splash Screen, and System Tray APIs, and JDK 7 stand-
ardizedthesupportfortranslucentandshapedwindowsfirstintroducedinJDK6up-
date 10 (build 12).
Appendix C covers Desktop, Splash Screen, System Tray, and translucent/shaped
windows.
Toolkits
AWT uses toolkits to abstract over windowing systems. A toolkit is a concrete imple-
mentation of AWT's abstract java.awt.Toolkit class. AWT provides a separate
toolkitforeachwindowingsystemusedbytheWindows,Solaris,Linux,andMacOS
platforms.
Toolkit declaresvariousmethodsthatAWTcallstoobtaininformationaboutthe
platform'swindowingsystem,andtoperformvariouswindowingsystem-specifictasks.
For example, void beep() emits an audio beep.
Mostapplicationsshouldnotcallanyof Toolkit 'smethodsdirectly;theyareinten-
ded for use by AWT. However, you might occasionally find it helpful to call some of
these methods.
Search WWH ::




Custom Search