gridbaglayout.html

来自「API資料大全」· HTML 代码 · 共 1,184 行 · 第 1/4 页

HTML
1,184
字号
<DL><DD>Determines which cell in the layout grid contains the point specified by <code>(x,&nbsp;y)</code>. Each cell is identified by its column index (ranging from 0 to the number of columns minus 1) and its row index (ranging from 0 to the number of rows minus 1). <p> If the <code>(x,&nbsp;y)</code> point lies outside the grid, the following rules are used. The column index is returned as zero if <code>x</code> lies to the left of the layout, and as the number of columns if <code>x</code> lies to the right of the layout. The row index is returned as zero if <code>y</code> lies above the layout, and as the number of rows if <code>y</code> lies below the layout.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the <i>x</i> coordinate of a point.<DD><CODE>y</CODE> - the <i>y</i> coordinate of a point.<DT><B>Returns:</B><DD>an ordered pair of indexes that indicate which cell             in the layout grid contains the point             (<i>x</i>,&nbsp;<i>y</i>).<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="addLayoutComponent(java.lang.String, java.awt.Component)"><!-- --></A><H3>addLayoutComponent</H3><PRE>public void <B>addLayoutComponent</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;name,                               <A HREF="../../java/awt/Component.html">Component</A>&nbsp;comp)</PRE><DL><DD>Adds the specified component with the specified name to the layout.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/LayoutManager.html#addLayoutComponent(java.lang.String, java.awt.Component)">addLayoutComponent</A></CODE> in interface <CODE><A HREF="../../java/awt/LayoutManager.html">LayoutManager</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the component.<DD><CODE>comp</CODE> - the component to be added.</DL></DD></DL><HR><A NAME="addLayoutComponent(java.awt.Component, java.lang.Object)"><!-- --></A><H3>addLayoutComponent</H3><PRE>public void <B>addLayoutComponent</B>(<A HREF="../../java/awt/Component.html">Component</A>&nbsp;comp,                               <A HREF="../../java/lang/Object.html">Object</A>&nbsp;constraints)</PRE><DL><DD>Adds the specified component to the layout, using the specified constraint object.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/LayoutManager2.html#addLayoutComponent(java.awt.Component, java.lang.Object)">addLayoutComponent</A></CODE> in interface <CODE><A HREF="../../java/awt/LayoutManager2.html">LayoutManager2</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>comp</CODE> - the component to be added.<DD><CODE>constraints</CODE> - an object that determines how                              the component is added to the layout.</DL></DD></DL><HR><A NAME="removeLayoutComponent(java.awt.Component)"><!-- --></A><H3>removeLayoutComponent</H3><PRE>public void <B>removeLayoutComponent</B>(<A HREF="../../java/awt/Component.html">Component</A>&nbsp;comp)</PRE><DL><DD>Removes the specified component from this layout. <p> Most applications do not call this method directly.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/LayoutManager.html#removeLayoutComponent(java.awt.Component)">removeLayoutComponent</A></CODE> in interface <CODE><A HREF="../../java/awt/LayoutManager.html">LayoutManager</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>comp</CODE> - the component to be removed.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Container.html#remove(java.awt.Component)"><CODE>Container.remove(java.awt.Component)</CODE></A>, <A HREF="../../java/awt/Container.html#removeAll()"><CODE>Container.removeAll()</CODE></A></DL></DD></DL><HR><A NAME="preferredLayoutSize(java.awt.Container)"><!-- --></A><H3>preferredLayoutSize</H3><PRE>public <A HREF="../../java/awt/Dimension.html">Dimension</A> <B>preferredLayoutSize</B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;parent)</PRE><DL><DD>Determines the preferred size of the <code>target</code> container using this grid bag layout. <p> Most applications do not call this method directly.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/LayoutManager.html#preferredLayoutSize(java.awt.Container)">preferredLayoutSize</A></CODE> in interface <CODE><A HREF="../../java/awt/LayoutManager.html">LayoutManager</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>target</CODE> - the container in which to do the layout.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Container.html#getPreferredSize()"><CODE>Container.getPreferredSize()</CODE></A></DL></DD></DL><HR><A NAME="minimumLayoutSize(java.awt.Container)"><!-- --></A><H3>minimumLayoutSize</H3><PRE>public <A HREF="../../java/awt/Dimension.html">Dimension</A> <B>minimumLayoutSize</B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;parent)</PRE><DL><DD>Determines the minimum size of the <code>target</code> container using this grid bag layout. <p> Most applications do not call this method directly.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/LayoutManager.html#minimumLayoutSize(java.awt.Container)">minimumLayoutSize</A></CODE> in interface <CODE><A HREF="../../java/awt/LayoutManager.html">LayoutManager</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>target</CODE> - the container in which to do the layout.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Container.html#doLayout()"><CODE>Container.doLayout()</CODE></A></DL></DD></DL><HR><A NAME="maximumLayoutSize(java.awt.Container)"><!-- --></A><H3>maximumLayoutSize</H3><PRE>public <A HREF="../../java/awt/Dimension.html">Dimension</A> <B>maximumLayoutSize</B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;target)</PRE><DL><DD>Returns the maximum dimensions for this layout given the components in the specified target container.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/LayoutManager2.html#maximumLayoutSize(java.awt.Container)">maximumLayoutSize</A></CODE> in interface <CODE><A HREF="../../java/awt/LayoutManager2.html">LayoutManager2</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>target</CODE> - the component which needs to be laid out<DT><B>See Also: </B><DD><A HREF="../../java/awt/Container.html"><CODE>Container</CODE></A>, <A HREF="../../java/awt/GridBagLayout.html#minimumLayoutSize(java.awt.Container)"><CODE>minimumLayoutSize(Container)</CODE></A>, <A HREF="../../java/awt/GridBagLayout.html#preferredLayoutSize(java.awt.Container)"><CODE>preferredLayoutSize(Container)</CODE></A></DL></DD></DL><HR><A NAME="getLayoutAlignmentX(java.awt.Container)"><!-- --></A><H3>getLayoutAlignmentX</H3><PRE>public float <B>getLayoutAlignmentX</B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;parent)</PRE><DL><DD>Returns the alignment along the x axis.  This specifies how the component would like to be aligned relative to other components.  The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/LayoutManager2.html#getLayoutAlignmentX(java.awt.Container)">getLayoutAlignmentX</A></CODE> in interface <CODE><A HREF="../../java/awt/LayoutManager2.html">LayoutManager2</A></CODE></DL></DD></DL><HR><A NAME="getLayoutAlignmentY(java.awt.Container)"><!-- --></A><H3>getLayoutAlignmentY</H3><PRE>public float <B>getLayoutAlignmentY</B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;parent)</PRE><DL><DD>Returns the alignment along the y axis.  This specifies how the component would like to be aligned relative to other components.  The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/LayoutManager2.html#getLayoutAlignmentY(java.awt.Container)">getLayoutAlignmentY</A></CODE> in interface <CODE><A HREF="../../java/awt/LayoutManager2.html">LayoutManager2</A></CODE></DL></DD></DL><HR><A NAME="invalidateLayout(java.awt.Container)"><!-- --></A><H3>invalidateLayout</H3><PRE>public void <B>invalidateLayout</B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;target)</PRE><DL><DD>Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/LayoutManager2.html#invalidateLayout(java.awt.Container)">invalidateLayout</A></CODE> in interface <CODE><A HREF="../../java/awt/LayoutManager2.html">LayoutManager2</A></CODE></DL></DD></DL><HR><A NAME="layoutContainer(java.awt.Container)"><!-- --></A><H3>layoutContainer</H3><PRE>public void <B>layoutContainer</B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;parent)</PRE><DL><DD>Lays out the specified container using this grid bag layout. This method reshapes components in the specified container in order to satisfy the contraints of this <code>GridBagLayout</code> object. <p> Most applications do not call this method directly.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/LayoutManager.html#layoutContainer(java.awt.Container)">layoutContainer</A></CODE> in interface <CODE><A HREF="../../java/awt/LayoutManager.html">LayoutManager</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parent</CODE> - the container in which to do the layout.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Container.html"><CODE>Container</CODE></A>, <A HREF="../../java/awt/Container.html#doLayout()"><CODE>Container.doLayout()</CODE></A></DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Returns a string representation of this grid bag layout's values.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a string representation of this grid bag layout.</DL></DD></DL><HR><A NAME="GetLayoutInfo(java.awt.Container, int)"><!-- --></A><H3>GetLayoutInfo</H3><PRE>protected java.awt.GridBagLayoutInfo <B>GetLayoutInfo</B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;parent,                                                   int&nbsp;sizeflag)</PRE><DL><DD>Print the layout constraints.  Useful for debugging.<DD><DL></DL></DD></DL><HR><A NAME="AdjustForGravity(java.awt.GridBagConstraints, java.awt.Rectangle)"><!-- --></A><H3>AdjustForGravity</H3><PRE>protected void <B>AdjustForGravity</B>(<A HREF="../../java/awt/GridBagConstraints.html">GridBagConstraints</A>&nbsp;constraints,                                <A HREF="../../java/awt/Rectangle.html">Rectangle</A>&nbsp;r)</PRE><DL><DD><DL></DL></DD></DL><HR><A NAME="GetMinSize(java.awt.Container, java.awt.GridBagLayoutInfo)"><!-- --></A><H3>GetMinSize</H3><PRE>protected <A HREF="../../java/awt/Dimension.html">Dimension</A> <B>GetMinSize</B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;parent,                               java.awt.GridBagLayoutInfo&nbsp;info)</PRE><DL><DD><DL></DL></DD></DL><HR><A NAME="ArrangeGrid(java.awt.Container)"><!-- --></A><H3>ArrangeGrid</H3><PRE>protected void <B>ArrangeGrid</B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;parent)</PRE><DL><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/GridBagLayout.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../java/awt/GridBagConstraints.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/awt/GridLayout.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>  &nbsp;&nbsp;<A HREF="GridBagLayout.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation  contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?