Java Reference
In-Depth Information
Table26-2
CommonlyUsedMethodsoftheWindowClass(continued)
RETURNS
NAME
DESCRIPTION
Locale
getLocale()
GetstheLocaleobjectthatis
associatedwiththiswindow,ifone
hasbeendefined.
indow[]
getOwnedWindows()
Returnanarraycontainingallthe
windowsthiswindowcurrently
owns.
Window
getOwner()
Returnstheownerofthiswindow.
void
hide()
HidethisWindow.
boolean
isShowing()ChecksifthisWindowiscurrently
displayed.
void
pack()
CausesthisWindowtobesizedto
fitthepreferredsizeandlayouts
ofitssubcomponents.
protected
void
processEvent(AWTEvente)
Processeseventsonthiswindow.
protected
void
processWindowEvent(WindowEvente)
Processeswindowevents
occurringonthiswindowby
dispatchingthemtoanyregistered
WindowListenerobject.
void
removeWindowListener(WindowListenerl)
Removesthespecifiedwindow
listener.
void
setCursor(Cursorcursor)
Setthecursorimagetoa
specifiedcursor.
void
show()
MakestheWindowvisible.
void
toBack()
Sendsthiswindowtotheback.
void
toFront()
Bringsthiswindowtothefront.
Container class
Thejava.awt.Containerclassdefinesagenericcontainerobjectthatcan
containothercontainersorcomponents.AJavacontainerobjectisarect-
angularareainwhichotherprogramelementscanbeplaced.TheCon-
tainerclassisasubclassofComponent.Thismeansthatcontainerobjects
canbenestedoneinsidetheotherone.TheContainerclasscontainsover
50methods.
Table26-3
isaselectionofsomeofthemostfrequentlyused
methods in the Container class.