📄 box.html
字号:
<HR><A NAME="createGlue()"><!-- --></A><H3>createGlue</H3><PRE>public static <A HREF="../../java/awt/Component.html">Component</A> <B>createGlue</B>()</PRE><DL><DD>Creates an invisible "glue" component that can be useful in a Box whose visible components have a maximum width (for a horizontal box) or height (for a vertical box). You can think of the glue component as being a gooey substance that expands as much as necessary to fill the space between its neighboring components. <p> For example, suppose you have a horizontal box that contains two fixed-size components. If the box gets extra space, the fixed-size components won't become larger, so where does the extra space go? Without glue, the extra space goes to the right of the second component. If you put glue between the fixed-size components, then the extra space goes there. If you put glue before the first fixed-size component, the extra space goes there, and the fixed-size components are shoved against the right edge of the box. If you put glue before the first fixed-size component and after the second fixed-size component, the fixed-size components are centered in the box. <p> To use glue, call <code>Box.createGlue</code> and add the returned component to a container. The glue component has no minimum or preferred size, so it takes no space unless excess space is available. If excess space is available, then the glue component takes its share of available horizontal or vertical space, just like any other component that has no maximum width or height.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the component</DL></DD></DL><HR><A NAME="createHorizontalGlue()"><!-- --></A><H3>createHorizontalGlue</H3><PRE>public static <A HREF="../../java/awt/Component.html">Component</A> <B>createHorizontalGlue</B>()</PRE><DL><DD>Creates a horizontal glue component.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the component</DL></DD></DL><HR><A NAME="createVerticalGlue()"><!-- --></A><H3>createVerticalGlue</H3><PRE>public static <A HREF="../../java/awt/Component.html">Component</A> <B>createVerticalGlue</B>()</PRE><DL><DD>Creates a vertical glue component.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the component</DL></DD></DL><HR><A NAME="setLayout(java.awt.LayoutManager)"><!-- --></A><H3>setLayout</H3><PRE>public void <B>setLayout</B>(<A HREF="../../java/awt/LayoutManager.html">LayoutManager</A> l)</PRE><DL><DD>Throws an AWTError, since a Box can use only a BoxLayout.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/awt/Container.html#setLayout(java.awt.LayoutManager)">setLayout</A></CODE> in class <CODE><A HREF="../../java/awt/Container.html">Container</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>l</CODE> - the layout manager to use</DL></DD></DL><HR><A NAME="getAccessibleContext()"><!-- --></A><H3>getAccessibleContext</H3><PRE>public <A HREF="../../javax/accessibility/AccessibleContext.html">AccessibleContext</A> <B>getAccessibleContext</B>()</PRE><DL><DD>Gets the AccessibleContext associated with this Box. For boxes, the AccessibleContext takes the form of an AccessibleBox. A new AccessibleAWTBox instance is created if necessary.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/Accessible.html#getAccessibleContext()">getAccessibleContext</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/Accessible.html">Accessible</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/awt/Component.html#getAccessibleContext()">getAccessibleContext</A></CODE> in class <CODE><A HREF="../../java/awt/Component.html">Component</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an AccessibleBox that serves as the AccessibleContext of this Box</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> </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/Box.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="../../javax/swing/BorderFactory.html"><B>PREV CLASS</B></A> <A HREF="../../javax/swing/Box.AccessibleBox.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="Box.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><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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -