frame.html
来自「API資料大全」· HTML 代码 · 共 1,137 行 · 第 1/5 页
HTML
1,137 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Apr 27 23:32:35 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Class Frame</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Frame.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../java/awt/FontMetrics.html"><B>PREV CLASS</B></A> <A HREF="../../java/awt/Frame.AccessibleAWTFrame.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Frame.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#inner_class_summary">INNER</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.awt</FONT><BR>Class Frame</H2><PRE><A HREF="../../java/lang/Object.html">java.lang.Object</A> | +--<A HREF="../../java/awt/Component.html">java.awt.Component</A> | +--<A HREF="../../java/awt/Container.html">java.awt.Container</A> | +--<A HREF="../../java/awt/Window.html">java.awt.Window</A> | +--<B>java.awt.Frame</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../javax/accessibility/Accessible.html">Accessible</A>, <A HREF="../../java/awt/image/ImageObserver.html">ImageObserver</A>, <A HREF="../../java/awt/MenuContainer.html">MenuContainer</A>, <A HREF="../../java/io/Serializable.html">Serializable</A></DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../javax/swing/JFrame.html">JFrame</A></DD></DL><HR><DL><DT>public class <B>Frame</B><DT>extends <A HREF="../../java/awt/Window.html">Window</A><DT>implements <A HREF="../../java/awt/MenuContainer.html">MenuContainer</A></DL><P>A Frame is a top-level window with a title and a border. <p> The size of the frame includes any area designated for the border. The dimensions of the border area can be obtained using the <code>getInsets</code> method, however, since these dimensions are platform-dependent, a valid insets value cannot be obtained until the frame is made displayable by either calling <code>pack</code> or <code>show</code>. Since the border area is included in the overall size of the frame, the border effectively obscures a portion of the frame, constraining the area available for rendering and/or displaying subcomponents to the rectangle which has an upper-left corner location of <code>(insets.left, insets.top)</code>, and has a size of <code>width - (insets.left + insets.right)</code> by <code>height - (insets.top + insets.bottom)</code>. <p> The default layout for a frame is BorderLayout. <p> In a multi-screen environment, you can create a <code>Frame</code> on a different screen device by constructing the <code>Frame</code> with <A HREF="../../java/awt/Frame.html#Frame(java.awt.GraphicsConfiguration)"><CODE>Frame(GraphicsConfiguration)</CODE></A> or <A HREF="../../java/awt/Frame.html#Frame(java.lang.String, java.awt.GraphicsConfiguration)"><CODE>Frame(String title, GraphicsConfiguration)</CODE></A>. The <code>GraphicsConfiguration</code> object is one of the <code>GraphicsConfiguration</code> objects of the target screen device. <p> In a virtual device multi-screen environment in which the desktop area could span multiple physical screen devices, the bounds of all configurations are relative to the virtual-coordinate system. The origin of the virtual-coordinate system is at the upper left-hand corner of the primary physical screen. Depending on the location of the primary screen in the virtual device, negative coordinates are possible, as shown in the following figure. <p> <img src="doc-files/MultiScreen.gif"> ALIGN=center HSPACE=10 VSPACE=7> <p> In such an environment, when calling <code>setLocation</code>, you must pass a virtual coordinate to this method. Similarly, calling <code>getLocationOnScreen</code> on a <code>Frame</code> returns virtual device coordinates. Call the <code>getBounds</code> method of a <code>GraphicsConfiguration</code> to find its origin in the virtual coordinate system. <p> The following code sets the location of the <code>Frame</code> at (10, 10) relative to the origin of the physical screen of the corresponding <code>GraphicsConfiguration</code>. If the bounds of the <code>GraphicsConfiguration</code> is not taken into account, the <code>Frame</code> location would be set at (10, 10) relative to the virtual-coordinate system and would appear on the primary physical screen, which might be different from the physical screen of the specified <code>GraphicsConfiguration</code>. <pre> Frame f = new Frame(GraphicsConfiguration gc); Rectangle bounds = gc.getBounds(); f.setLocation(10 + bounds.x, 10 + bounds.y); </pre> <p> Frames are capable of generating the following types of window events: WindowOpened, WindowClosing, WindowClosed, WindowIconified, WindowDeiconified, WindowActivated, WindowDeactivated.<P><DL><DT><B>Since: </B><DD>JDK1.0</DD><DT><B>See Also: </B><DD><A HREF="../../java/awt/event/WindowEvent.html"><CODE>WindowEvent</CODE></A>, <A HREF="../../java/awt/Window.html#addWindowListener(java.awt.event.WindowListener)"><CODE>Window.addWindowListener(java.awt.event.WindowListener)</CODE></A>, <A HREF="../../serialized-form.html#java.awt.Frame">Serialized Form</A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><A NAME="inner_class_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Inner Class Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected class</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Frame.AccessibleAWTFrame.html">Frame.AccessibleAWTFrame</A></B></CODE><BR> This class implements accessibility support for the <code>Frame</code> class.</TD></TR></TABLE> <A NAME="inner_classes_inherited_from_class_java.awt.Window"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Inner classes inherited from class java.awt.<A HREF="../../java/awt/Window.html">Window</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/awt/Window.AccessibleAWTWindow.html">Window.AccessibleAWTWindow</A></CODE></TD></TR></TABLE> <A NAME="inner_classes_inherited_from_class_java.awt.Container"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Inner classes inherited from class java.awt.<A HREF="../../java/awt/Container.html">Container</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/awt/Container.AccessibleAWTContainer.html">Container.AccessibleAWTContainer</A></CODE></TD></TR></TABLE> <A NAME="inner_classes_inherited_from_class_java.awt.Component"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Inner classes inherited from class java.awt.<A HREF="../../java/awt/Component.html">Component</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/awt/Component.AccessibleAWTComponent.html">Component.AccessibleAWTComponent</A></CODE></TD></TR></TABLE> <!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Frame.html#CROSSHAIR_CURSOR">CROSSHAIR_CURSOR</A></B></CODE><BR> <B>Deprecated.</B> <I>replaced by <code>Cursor.CROSSHAIR_CURSOR</code>.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Frame.html#DEFAULT_CURSOR">DEFAULT_CURSOR</A></B></CODE><BR> <B>Deprecated.</B> <I>replaced by <code>Cursor.DEFAULT_CURSOR</code>.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Frame.html#E_RESIZE_CURSOR">E_RESIZE_CURSOR</A></B></CODE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?