Java Reference
In-Depth Information
Thewidthandheightaresubsequentlyusedtoconstructa
Dimension
objectthat's
passed to
setPreferredSize()
. This preferred size will be taken into account
by
sp.doLayout();
, which is executed following the call to
ImageCanvas
's
setImage()
method—see
Listing 7-4
.
Figure 7-10.
Is it true that a rose by any other name would smell as sweet?
Note
AWT also supports image processing. For example, you can grayscale a
coloredimage,bluranimage,andsoon.BecauseJava2Dsimplifiesimageprocessing,
andbecauseIintroduceyoutoJava2D'simageprocessingsupportlaterinthischapter,
I don't discuss AWT-based image processing.
Data Transfer
GUI-based applications often need to transfer data between or within themselves. For
example, atexteditor'susermaywanttocutselected texttothesystemclipboard and
subsequently paste the clipboard's text to another location within the document being
edited.