cardlayout.html

来自「API資料大全」· HTML 代码 · 共 734 行 · 第 1/3 页

HTML
734
字号
<TD><CODE><B><A HREF="../../java/awt/CardLayout.html#preferredLayoutSize(java.awt.Container)">preferredLayoutSize</A></B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;parent)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines the preferred size of the container argument using this card layout.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/CardLayout.html#previous(java.awt.Container)">previous</A></B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;parent)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flips to the previous card of the specified container.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/CardLayout.html#removeLayoutComponent(java.awt.Component)">removeLayoutComponent</A></B>(<A HREF="../../java/awt/Component.html">Component</A>&nbsp;comp)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the specified component from the layout.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/CardLayout.html#setHgap(int)">setHgap</A></B>(int&nbsp;hgap)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the horizontal gap between components.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/CardLayout.html#setVgap(int)">setVgap</A></B>(int&nbsp;vgap)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the vertical gap between components.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/CardLayout.html#show(java.awt.Container, java.lang.String)">show</A></B>(<A HREF="../../java/awt/Container.html">Container</A>&nbsp;parent,     <A HREF="../../java/lang/String.html">String</A>&nbsp;name)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flips to the component that was added to this layout with the specified <code>name</code>, using <code>addLayoutComponent</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/CardLayout.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a string representation of the state of this card layout.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="CardLayout()"><!-- --></A><H3>CardLayout</H3><PRE>public <B>CardLayout</B>()</PRE><DL><DD>Creates a new card layout with gaps of size zero.</DL><HR><A NAME="CardLayout(int, int)"><!-- --></A><H3>CardLayout</H3><PRE>public <B>CardLayout</B>(int&nbsp;hgap,                  int&nbsp;vgap)</PRE><DL><DD>Creates a new card layout with the specified horizontal and vertical gaps. The horizontal gaps are placed at the left and right edges. The vertical gaps are placed at the top and bottom edges.<DD><DL><DT><B>Parameters:</B><DD><CODE>hgap</CODE> - the horizontal gap.<DD><CODE>vgap</CODE> - the vertical gap.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getHgap()"><!-- --></A><H3>getHgap</H3><PRE>public int <B>getHgap</B>()</PRE><DL><DD>Gets the horizontal gap between components.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the horizontal gap between components.<DT><B>Since: </B><DD>JDK1.1</DD><DT><B>See Also: </B><DD><A HREF="../../java/awt/CardLayout.html#setHgap(int)"><CODE>setHgap(int)</CODE></A>, <A HREF="../../java/awt/CardLayout.html#getVgap()"><CODE>getVgap()</CODE></A></DL></DD></DL><HR><A NAME="setHgap(int)"><!-- --></A><H3>setHgap</H3><PRE>public void <B>setHgap</B>(int&nbsp;hgap)</PRE><DL><DD>Sets the horizontal gap between components.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>hgap</CODE> - the horizontal gap between components.<DT><B>Since: </B><DD>JDK1.1</DD><DT><B>See Also: </B><DD><A HREF="../../java/awt/CardLayout.html#getHgap()"><CODE>getHgap()</CODE></A>, <A HREF="../../java/awt/CardLayout.html#setVgap(int)"><CODE>setVgap(int)</CODE></A></DL></DD></DL><HR><A NAME="getVgap()"><!-- --></A><H3>getVgap</H3><PRE>public int <B>getVgap</B>()</PRE><DL><DD>Gets the vertical gap between components.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the vertical gap between components.<DT><B>See Also: </B><DD><A HREF="../../java/awt/CardLayout.html#setVgap(int)"><CODE>setVgap(int)</CODE></A>, <A HREF="../../java/awt/CardLayout.html#getHgap()"><CODE>getHgap()</CODE></A></DL></DD></DL><HR><A NAME="setVgap(int)"><!-- --></A><H3>setVgap</H3><PRE>public void <B>setVgap</B>(int&nbsp;vgap)</PRE><DL><DD>Sets the vertical gap between components.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>vgap</CODE> - the vertical gap between components.<DT><B>Since: </B><DD>JDK1.1</DD><DT><B>See Also: </B><DD><A HREF="../../java/awt/CardLayout.html#getVgap()"><CODE>getVgap()</CODE></A>, <A HREF="../../java/awt/CardLayout.html#setHgap(int)"><CODE>setHgap(int)</CODE></A></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 this card layout's internal table of names. The object specified by <code>constraints</code> must be a string. The card layout stores this string as a key-value pair that can be used for random access to a particular card. By calling the <code>show</code> method, an application can display the component with the specified name.<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> - a tag that identifies a particular                                        card in the layout.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the constraint is not a string.<DT><B>See Also: </B><DD><A HREF="../../java/awt/CardLayout.html#show(java.awt.Container, java.lang.String)"><CODE>show(java.awt.Container, java.lang.String)</CODE></A></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><B>Deprecated.</B>&nbsp;<I>replaced by      <code>addLayoutComponent(Component, Object)</code>.</I><P><DD><B>Description copied from interface: <CODE><A HREF="../../java/awt/LayoutManager.html">LayoutManager</A></CODE></B></DD><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>Following copied from interface: <CODE>java.awt.LayoutManager</CODE></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the component name<DD><CODE>comp</CODE> - the component to be added</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 the layout.<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 container argument using this card layout.<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>parent</CODE> - the name of the parent container.<DT><B>Returns:</B><DD>the preferred dimensions to lay out the subcomponents

⌨️ 快捷键说明

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