component.html

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

HTML
1,274
字号
<TD><CODE><B><A HREF="../../java/awt/Component.html#getBackground()">getBackground</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the background color of this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Rectangle.html">Rectangle</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getBounds()">getBounds</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the bounds of this component in the form of a <code>Rectangle</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Rectangle.html">Rectangle</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getBounds(java.awt.Rectangle)">getBounds</A></B>(<A HREF="../../java/awt/Rectangle.html">Rectangle</A>&nbsp;rv)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Store the bounds of this component into "return value" <b>rv</b> and  return <b>rv</b>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/image/ColorModel.html">ColorModel</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getColorModel()">getColorModel</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the instance of <code>ColorModel</code> used to display the component on the output device.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Component.html">Component</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getComponentAt(int, int)">getComponentAt</A></B>(int&nbsp;x,               int&nbsp;y)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines if this component or one of its immediate subcomponents contains the (<i>x</i>,&nbsp;<i>y</i>) location, and if so, returns the containing component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Component.html">Component</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getComponentAt(java.awt.Point)">getComponentAt</A></B>(<A HREF="../../java/awt/Point.html">Point</A>&nbsp;p)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the component or subcomponent that contains the specified point.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/ComponentOrientation.html">ComponentOrientation</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getComponentOrientation()">getComponentOrientation</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieve the language-sensitive orientation that is to be used to order the elements or text within this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Cursor.html">Cursor</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getCursor()">getCursor</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the cursor set in the component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/dnd/DropTarget.html">DropTarget</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getDropTarget()">getDropTarget</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the DropTarget associated with this Component</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Font.html">Font</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getFont()">getFont</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the font of this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/FontMetrics.html">FontMetrics</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getFontMetrics(java.awt.Font)">getFontMetrics</A></B>(<A HREF="../../java/awt/Font.html">Font</A>&nbsp;font)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the font metrics for the specified font.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Color.html">Color</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getForeground()">getForeground</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the foreground color of this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Graphics.html">Graphics</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getGraphics()">getGraphics</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a graphics context for this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/GraphicsConfiguration.html">GraphicsConfiguration</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getGraphicsConfiguration()">getGraphicsConfiguration</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the <code>GraphicsConfiguration</code> associated with this <code>Component</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getHeight()">getHeight</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the current height of this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/im/InputContext.html">InputContext</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getInputContext()">getInputContext</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the input context used by this component for handling the communication with input methods when text is entered in this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/im/InputMethodRequests.html">InputMethodRequests</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getInputMethodRequests()">getInputMethodRequests</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the input method request handler which supports requests from input methods for this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/util/EventListener.html">EventListener</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getListeners(java.lang.Class)">getListeners</A></B>(<A HREF="../../java/lang/Class.html">Class</A>&nbsp;listenerType)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return an array of all the listeners that were added to the Component with addXXXListener(), where XXX is the name of the <code>listenerType</code> argument.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/util/Locale.html">Locale</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getLocale()">getLocale</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the locale of this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Point.html">Point</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getLocation()">getLocation</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the location of this component in the form of a point specifying the component's top-left corner.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Point.html">Point</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getLocation(java.awt.Point)">getLocation</A></B>(<A HREF="../../java/awt/Point.html">Point</A>&nbsp;rv)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Store the x,y origin of this component into "return value" <b>rv</b>  and return <b>rv</b>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Point.html">Point</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getLocationOnScreen()">getLocationOnScreen</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the location of this component in the form of a point specifying the component's top-left corner in the screen's coordinate space.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Dimension.html">Dimension</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getMaximumSize()">getMaximumSize</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the maximum size of this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Dimension.html">Dimension</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getMinimumSize()">getMinimumSize</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the mininimum size of this component.</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/Component.html#getName()">getName</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the name of the component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Container.html">Container</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getParent()">getParent</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the parent of this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.awt.peer.ComponentPeer</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getPeer()">getPeer</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>As of JDK version 1.1, programs should not directly manipulate peers. replaced by <code>boolean isDisplayable()</code>.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Dimension.html">Dimension</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getPreferredSize()">getPreferredSize</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the preferred size of this component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Dimension.html">Dimension</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getSize()">getSize</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the size of this component in the form of a <code>Dimension</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/Dimension.html">Dimension</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Component.html#getSize(java.awt.Dimension)">getSize</A></B>(<A HREF="../../java/awt/Dimension.html">Dimension</A>&nbsp;rv)</CODE><BR>

⌨️ 快捷键说明

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