50 |
import java.awt.event.KeyEvent; |
import java.awt.event.KeyEvent; |
51 |
import java.awt.event.WindowEvent; |
import java.awt.event.WindowEvent; |
52 |
|
|
53 |
|
import javax.accessibility.Accessible; |
54 |
import javax.accessibility.AccessibleContext; |
import javax.accessibility.AccessibleContext; |
55 |
|
|
56 |
/** |
/** |
57 |
* Unlike JComponent derivatives, JFrame inherits from |
* A window that supports window decorations (titlebar and borders). |
58 |
* java.awt.Frame. But also lets a look-and-feel component to its work. |
* This is an extension of {@link java.awt.Frame} that provides support |
59 |
|
* for the Swing architecture. Most importantly it contains a {@link JRootPane} |
60 |
|
* as it's only top-level child, that manages the content pane, the menu and |
61 |
|
* a glass pane. |
62 |
* |
* |
63 |
|
* Also, unlike <code>java.awt.Frame</code>s, JFrames support the |
64 |
|
* Swing Pluggable Look & Feel architecture. |
65 |
|
* |
66 |
* @author Ronald Veldema (rveldema@cs.vu.nl) |
* @author Ronald Veldema (rveldema@cs.vu.nl) |
67 |
*/ |
*/ |
68 |
public class JFrame extends Frame |
public class JFrame extends Frame |
69 |
implements WindowConstants, RootPaneContainer |
implements WindowConstants, RootPaneContainer, Accessible |
70 |
{ |
{ |
71 |
|
/** |
72 |
|
* Provides accessibility support for <code>JFrame</code>s. |
73 |
|
*/ |
74 |
|
protected class AccessibleJFrame extends Frame.AccessibleAWTFrame |
75 |
|
{ |
76 |
|
/** |
77 |
|
* Creates a new instance of <code>AccessibleJFrame</code>. |
78 |
|
*/ |
79 |
|
public AccessibleJFrame() |
80 |
|
{ |
81 |
|
super(); |
82 |
|
// Nothing to do here. |
83 |
|
} |
84 |
|
} |
85 |
|
|
86 |
private static final long serialVersionUID = -3362141868504252139L; |
private static final long serialVersionUID = -3362141868504252139L; |
87 |
private static boolean defaultLookAndFeelDecorated; |
private static boolean defaultLookAndFeelDecorated; |
88 |
private int close_action = HIDE_ON_CLOSE; |
private int close_action = HIDE_ON_CLOSE; |
291 |
|
|
292 |
public AccessibleContext getAccessibleContext() |
public AccessibleContext getAccessibleContext() |
293 |
{ |
{ |
294 |
|
if (accessibleContext == null) |
295 |
|
accessibleContext = new AccessibleJFrame(); |
296 |
return accessibleContext; |
return accessibleContext; |
297 |
} |
} |
298 |
|
|