📄 swingutilities.html
字号:
<BR> Convenience method to change the UI ActionMap for <code>component</code> to <code>uiActionMap</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#replaceUIInputMap(javax.swing.JComponent, int, javax.swing.InputMap)">replaceUIInputMap</A></B>(<A HREF="../../javax/swing/JComponent.html">JComponent</A> component, int type, <A HREF="../../javax/swing/InputMap.html">InputMap</A> uiInputMap)</CODE><BR> Convenience method to change the UI InputMap for <code>component</code> to <code>uiInputMap</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#updateComponentTreeUI(java.awt.Component)">updateComponentTreeUI</A></B>(<A HREF="../../java/awt/Component.html">Component</A> c)</CODE><BR> A simple minded look and feel change: ask each node in the tree to updateUI() -- that is, to initialize its UI property with the current look and feel.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/awt/Window.html">Window</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#windowForComponent(java.awt.Component)">windowForComponent</A></B>(<A HREF="../../java/awt/Component.html">Component</A> aComponent)</CODE><BR> Return <code>aComponent</code>'s window</TD></TR></TABLE> <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#toString()">toString</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> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ 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="isRectangleContainingRectangle(java.awt.Rectangle, java.awt.Rectangle)"><!-- --></A><H3>isRectangleContainingRectangle</H3><PRE>public static final boolean <B>isRectangleContainingRectangle</B>(<A HREF="../../java/awt/Rectangle.html">Rectangle</A> a, <A HREF="../../java/awt/Rectangle.html">Rectangle</A> b)</PRE><DL><DD>Return true if <code>a</code> contains <code>b</code><DD><DL></DL></DD></DL><HR><A NAME="getLocalBounds(java.awt.Component)"><!-- --></A><H3>getLocalBounds</H3><PRE>public static <A HREF="../../java/awt/Rectangle.html">Rectangle</A> <B>getLocalBounds</B>(<A HREF="../../java/awt/Component.html">Component</A> aComponent)</PRE><DL><DD>Return the rectangle (0,0,bounds.width,bounds.height) for the component <code>aComponent</code><DD><DL></DL></DD></DL><HR><A NAME="getWindowAncestor(java.awt.Component)"><!-- --></A><H3>getWindowAncestor</H3><PRE>public static <A HREF="../../java/awt/Window.html">Window</A> <B>getWindowAncestor</B>(<A HREF="../../java/awt/Component.html">Component</A> c)</PRE><DL><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the first Window ancestor of c, or null if component is not contained inside a window</DL></DD></DL><HR><A NAME="convertPoint(java.awt.Component, java.awt.Point, java.awt.Component)"><!-- --></A><H3>convertPoint</H3><PRE>public static <A HREF="../../java/awt/Point.html">Point</A> <B>convertPoint</B>(<A HREF="../../java/awt/Component.html">Component</A> source, <A HREF="../../java/awt/Point.html">Point</A> aPoint, <A HREF="../../java/awt/Component.html">Component</A> destination)</PRE><DL><DD>Convert a <code>aPoint</code> in <code>source</code> coordinate system to <code>destination</code> coordinate system. If <code>source></code>is null,<code>aPoint</code> is assumed to be in <code>destination</code>'s root component coordinate system. If <code>destination</code>is null, <code>aPoint</code> will be converted to <code>source</code>'s root component coordinate system. If both <code>source</code> and <code>destination</code> are null, return <code>aPoint</code> without any conversion.<DD><DL></DL></DD></DL><HR><A NAME="convertPoint(java.awt.Component, int, int, java.awt.Component)"><!-- --></A><H3>convertPoint</H3><PRE>public static <A HREF="../../java/awt/Point.html">Point</A> <B>convertPoint</B>(<A HREF="../../java/awt/Component.html">Component</A> source, int x, int y, <A HREF="../../java/awt/Component.html">Component</A> destination)</PRE><DL><DD>Convert the point <code>(x,y)</code> in <code>source</code> coordinate system to <code>destination</code> coordinate system. If <code>source></code>is null,<code>(x,y)</code> is assumed to be in <code>destination</code>'s root component coordinate system. If <code>destination</code>is null, <code>(x,y)</code> will be converted to <code>source</code>'s root component coordinate system. If both <code>source</code> and <code>destination</code> are null, return <code>(x,y)</code> without any conversion.<DD><DL></DL></DD></DL><HR><A NAME="convertRectangle(java.awt.Component, java.awt.Rectangle, java.awt.Component)"><!-- --></A><H3>convertRectangle</H3><PRE>public static <A HREF="../../java/awt/Rectangle.html">Rectangle</A> <B>convertRectangle</B>(<A HREF="../../java/awt/Component.html">Component</A> source, <A HREF="../../java/awt/Rectangle.html">Rectangle</A> aRectangle, <A HREF="../../java/awt/Component.html">Component</A> destination)</PRE><DL><DD>Convert the rectangle <code>aRectangle</code> in <code>source</code> coordinate system to <code>destination</code> coordinate system. If <code>source></code>is null,<code>aRectangle</code> is assumed to be in <code>destination</code>'s root component coordinate system. If <code>destination</code>is null, <code>aRectangle</code> will be converted to <code>source</code>'s root component coordinate system. If both <code>source</code> and <code>destination</code> are null, return <code>aRectangle</code> without any conversion.<DD><DL></DL></DD></DL><HR><A NAME="getAncestorOfClass(java.lang.Class, java.awt.Component)"><!-- --></A><H3>getAncestorOfClass</H3><PRE>public static <A HREF="../../java/awt/Container.html">Container</A> <B>getAncestorOfClass</B>(<A HREF="../../java/lang/Class.html">Class</A> c, <A HREF="../../java/awt/Component.html">Component</A> comp)</PRE><DL><DD>Convenience method for searching above <code>comp</code> in the component hierarchy and returns the first object of class <code>c</code> it finds. Can return null, if a class <code>c</code> cannot be found.<DD><DL></DL></DD></DL><HR><A NAME="getAncestorNamed(java.lang.String, java.awt.Component)"><!-- --></A><H3>getAncestorNamed</H3><PRE>public static <A HREF="../../java/awt/Container.html">Container</A> <B>getAncestorNamed</B>(<A HREF="../../java/lang/String.html">String</A> name, <A HREF="../../java/awt/Component.html">Component</A> comp)</PRE><DL><DD>Convenience method for searching above <code>comp</code> in the component hierarchy and returns the first object of <code>name</code> it finds. Can return null, if <code>name</code> cannot be found.<DD><DL></DL></DD></DL><HR><A NAME="getDeepestComponentAt(java.awt.Component, int, int)"><!-- --></A><H3>getDeepestComponentAt</H3><PRE>public static <A HREF="../../java/awt/Component.html">Component</A> <B>getDeepestComponentAt</B>(<A HREF="../../java/awt/Component.html">Component</A> parent, int x, int y)</PRE><DL><DD>Returns the deepest visible descendent Component of <code>parent</code> that contains the location <code>x</code>, <code>y</code>. If <code>parent</code> does not contain the specified location, then <code>null</code> is returned. If <code>parent</code> is not a container, or none of <code>parent</code>'s visible descendents contain the specified location, <code>parent</code> is returned.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parent</CODE> - the root component to begin the search<DD><CODE>x</CODE> - the x target location<DD><CODE>y</CODE> - the y target location</DL></DD></DL><HR><A NAME="convertMouseEvent(java.awt.Component, java.awt.event.MouseEvent, java.awt.Component)"><!-- --></A><H3>convertMouseEvent</H3><PRE>public static <A HREF="../../java/awt/event/MouseEvent.html">MouseEvent</A> <B>convertMouseEvent</B>(<A HREF="../../java/awt/Component.html">Component</A> source, <A HREF="../../java/awt/event/MouseEvent.html">MouseEvent</A> sourceEvent, <A HREF="../../java/awt/Component.html">Component</A> destination)</PRE><DL><DD>Returns a MouseEvent similar to <code>sourceEvent</code> except that its x and y members have been converted to <code>destination</code>'s coordinate system. If <code>source</code> is null, <code>sourceEvent</code> x and y members are assumed to be into <code>destination</code>'s root component coordinate system. If <code>destination</code> is <code>null</code>, the returned MouseEvent will be in <code>source</code>'s coordinate system. <code>sourceEvent</code> will not be changed. A new event is returned. the <code>source</code> field of the returned event will be set to <code>destination</code> if destination is non null use the translateMouseEvent() method to translate a mouse event from one component to another without changing the source.<DD><DL></DL></DD></DL><HR><A NAME="convertPointToScreen(java.awt.Point, java.awt.Component)"><!-- --></A><H3>convertPointToScreen</H3><PRE>public static void <B>convertPointToScreen</B>(<A HREF="../../java/awt/Point.html">Point</A> p, <A HREF="../../java/awt/Component.html">Component</A> c)</PRE><DL><DD>Convert a point from a component's coordinate system to screen coordinates.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>p</CODE> - a Point object (converted to the new coordinate system)<DD><CODE>c</CODE> - a Component object</DL></DD></DL><HR><A NAME="convertPointFromScreen(java.awt.Point, java.awt.Component)"><!-- --></A><H3>convertPointFromScreen</H3><PRE>public static void <B>convertPointFromScreen</B>(<A HREF="../../java/awt/Point.html">Point</A> p,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -