|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window
A Window
object is a top-level window with no borders and no
menubar.
The default layout for a window is BorderLayout
.
A window must have either a frame, dialog, or another window defined as its owner when it's constructed.
Windows are capable of generating the following window events: WindowOpened, WindowClosed.
WindowEvent
,
addWindowListener(java.awt.event.WindowListener)
,
BorderLayout
, Serialized FormInner classes inherited from class java.awt.Component |
Component.AWTTreeLock,
Component.NativeInLightFixer |
Field Summary | |
private boolean |
active
|
private static String |
base
|
private FocusManager |
focusMgr
The Focus for the Window in question, and its components. |
(package private) java.awt.im.InputContext |
inputContext
|
private static int |
nameCounter
|
(package private) static int |
OPENED
|
(package private) Vector |
ownedWindowList
A vector containing all the windows this window currently owns. |
private static long |
serialVersionUID
|
(package private) int |
state
An Integer value representing the Window State. |
(package private) String |
warningString
This represents the warning message that is to be displayed in a non secure window. |
private java.lang.ref.WeakReference |
weakThis
|
(package private) WindowListener |
windowListener
|
private int |
windowSerializedDataVersion
The window serialized data version. |
Fields inherited from class java.awt.Container |
component,
containerListener,
containerSerializedDataVersion,
dispatcher,
layoutMgr,
maxSize,
ncomponents,
serialVersionUID |
Constructor Summary | |
(package private) |
Window()
Constructs a new window. |
|
Window(Frame owner)
Constructs a new invisible window. |
|
Window(Window owner)
Constructs a new invisible window with the specified window as its owner. |
Method Summary | |
(package private) static void |
|
void |
addNotify()
Makes this Window displayable by creating the connection to its native screen resource. |
(package private) void |
addOwnedWindow(java.lang.ref.WeakReference weakWindow)
|
void |
addWindowListener(WindowListener l)
Adds the specified window listener to receive window events from this window. |
void |
applyResourceBundle(ResourceBundle rb)
Apply the settings in the given ResourceBundle to this Window. |
void |
applyResourceBundle(String rbName)
Load the ResourceBundle with the given name using the default locale and apply its settings to this window. |
(package private) void |
connectOwnedWindow(Window child)
|
(package private) String |
constructComponentName()
Construct a name for this component. |
(package private) void |
dispatchEventImpl(AWTEvent e)
|
void |
dispose()
Releases all of the native screen resources used by this Window and its subcomponents. |
(package private) boolean |
eventEnabled(AWTEvent e)
|
protected void |
finalize()
Disposes of the input methods and context, and removes the WeakReference which formerly pointed to this Window from the parent's owned Window list. |
Component |
getFocusOwner()
Returns the child component of this Window which has focus if and only if this Window is active. |
java.awt.im.InputContext |
getInputContext()
Gets the input context for this window. |
Locale |
getLocale()
Gets the Locale object that is associated
with this window, if the locale has been set. |
Window[] |
getOwnedWindows()
Return an array containing all the windows this window currently owns. |
Window |
getOwner()
Returns the owner of this window. |
Toolkit |
getToolkit()
Returns the toolkit of this frame. |
String |
getWarningString()
Gets the warning string that is displayed with this window. |
private static void |
initIDs()
Initialize JNI field and method IDs for fields that may be accessed from C. |
(package private) boolean |
isActive()
|
boolean |
isShowing()
Checks if this Window is showing on screen. |
(package private) void |
nextFocus(Component base)
Deprecated. As of JDK version 1.1, replaced by transferFocus(Component) . |
private void |
ownedInit(Window owner)
|
void |
pack()
Causes this Window to be sized to fit the preferred size and layouts of its subcomponents. |
boolean |
postEvent(Event e)
Deprecated. As of JDK version 1.1 replaced by dispatchEvent(AWTEvent) . |
(package private) void |
postProcessKeyEvent(KeyEvent e)
|
(package private) void |
postWindowEvent(int id)
|
(package private) void |
preProcessKeyEvent(KeyEvent e)
|
protected void |
processEvent(AWTEvent e)
Processes events on this window. |
protected void |
processWindowEvent(WindowEvent e)
Processes window events occurring on this window by dispatching them to any registered WindowListener objects. |
private void |
readObject(ObjectInputStream s)
Read the default ObjectInputStream, a possibly null listener to receive item events fired by the Window, and a possibly null list of child Windows. |
(package private) void |
removeOwnedWindow(java.lang.ref.WeakReference weakWindow)
|
void |
removeWindowListener(WindowListener l)
Removes the specified window listener so that it no longer receives window events from this window. |
(package private) void |
setFocusOwner(Component c)
|
private void |
setWarningString()
|
void |
show()
Makes the Window visible. |
void |
toBack()
Sends this window to the back. |
void |
toFront()
Brings this window to the front. |
(package private) void |
transferFocus(Component base)
|
private void |
writeObject(ObjectOutputStream s)
Writes default serializable fields to stream. |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
Field Detail |
String warningString
getWarningString()
static final int OPENED
int state
show()
transient Vector ownedWindowList
getOwnedWindows()
private transient java.lang.ref.WeakReference weakThis
transient WindowListener windowListener
private transient boolean active
transient java.awt.im.InputContext inputContext
private FocusManager focusMgr
private static final String base
private static int nameCounter
private static final long serialVersionUID
private int windowSerializedDataVersion
Constructor Detail |
Window()
First, if there is a security manager, its
checkTopLevelWindow
method is called with this
as its argument
to see if it's ok to display the window without a warning banner.
If the default implementation of checkTopLevelWindow
is used (that is, that method is not overriden), then this results in
a call to the security manager's checkPermission
method with an
AWTPermission("showWindowWithoutWarningBanner")
permission. It that method raises a SecurityException,
checkTopLevelWindow
returns false, otherwise it
returns true. If it returns false, a warning banner is created.
public Window(Frame owner)
The window is not initially visible. Call the show
method to cause the window to become visible.
If there is a security manager, this method first calls
the security manager's checkTopLevelWindow
method with this
as its argument to determine whether or not the window
must be displayed with a warning banner.
owner
- the main application frame.owner
is null
show()
,
Component.setSize(int, int)
,
SecurityManager.checkTopLevelWindow(java.lang.Object)
public Window(Window owner)
If there is a security manager, this method first calls
the security manager's checkTopLevelWindow
method with this
as its argument to determine whether or not the window
must be displayed with a warning banner.
owner
- the window to act as ownerowner
is null
SecurityManager.checkTopLevelWindow(java.lang.Object)
Method Detail |
static void()
private static void initIDs()
private void ownedInit(Window owner)
protected void finalize() throws Throwable
String constructComponentName()
public void addNotify()
Component.isDisplayable()
,
Container.removeNotify()
public void pack()
Component.isDisplayable()
public void show()
Component.isDisplayable()
,
toFront()
,
Component.setVisible(boolean)
void postWindowEvent(int id)
public void dispose()
The Window and its subcomponents can be made displayable again
by rebuilding the native resources with a subsequent call to
pack
or show
. The states of the recreated
Window and its subcomponents will be identical to the states of these
objects at the point where the Window was disposed (not accounting for
additional modifcations between those actions).
Component.isDisplayable()
,
getOwnedWindows()
,
pack()
,
show()
public void toFront()
toBack()
public void toBack()
toFront()
public Toolkit getToolkit()
Toolkit
,
Toolkit.getDefaultToolkit()
,
Component.getToolkit()
public final String getWarningString()
checkTopLevelWindow
method returns
false
when this window is passed to it as an
argument.
If the window is secure, then getWarningString
returns null
. If the window is insecure, this
method checks for the system property
awt.appletWarning
and returns the string value of that property.
SecurityManager.checkTopLevelWindow(java.lang.Object)
private void setWarningString()
public Locale getLocale()
Locale
object that is associated
with this window, if the locale has been set.
If no locale has been set, then the default locale
is returned.Locale
public java.awt.im.InputContext getInputContext()
Component.getInputContext()
public Window getOwner()
public Window[] getOwnedWindows()
public void addWindowListener(WindowListener l)
l
- the window listenerpublic void removeWindowListener(WindowListener l)
l
- the window listenerboolean eventEnabled(AWTEvent e)
boolean isActive()
protected void processEvent(AWTEvent e)
e
- the eventprotected void processWindowEvent(WindowEvent e)
e
- the window eventComponent.enableEvents(long)
void preProcessKeyEvent(KeyEvent e)
void postProcessKeyEvent(KeyEvent e)
void setFocusOwner(Component c)
void transferFocus(Component base)
public Component getFocusOwner()
void nextFocus(Component base)
transferFocus(Component)
.void dispatchEventImpl(AWTEvent e)
public boolean postEvent(Event e)
dispatchEvent(AWTEvent)
.public boolean isShowing()
Component.setVisible(boolean)
public void applyResourceBundle(ResourceBundle rb)
ComponentOrientation
public void applyResourceBundle(String rbName)
ComponentOrientation
void addOwnedWindow(java.lang.ref.WeakReference weakWindow)
void removeOwnedWindow(java.lang.ref.WeakReference weakWindow)
void connectOwnedWindow(Window child)
private void writeObject(ObjectOutputStream s) throws IOException
AWTEventMulticaster.save(ObjectOutputStream, String, EventListener)
,
java.awt.Component.itemListenerK
,
java.awt.Component.ownedWindowK
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException
removeActionListener()
,
addActionListener()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |