📄 swingutilities.html
字号:
<CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#getAccessibleIndexInParent(java.awt.Component)">getAccessibleIndexInParent</A></B>(<A HREF="../../java/awt/Component.html">Component</A> c)</CODE><BR> Get the index of this object in its accessible parent.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../javax/accessibility/AccessibleStateSet.html">AccessibleStateSet</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#getAccessibleStateSet(java.awt.Component)">getAccessibleStateSet</A></B>(<A HREF="../../java/awt/Component.html">Component</A> c)</CODE><BR> Get the state of this object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/awt/Container.html">Container</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#getAncestorNamed(java.lang.String, java.awt.Component)">getAncestorNamed</A></B>(<A HREF="../../java/lang/String.html">String</A> name, <A HREF="../../java/awt/Component.html">Component</A> comp)</CODE><BR> Convenience method for searching above <code>comp</code> in the component hierarchy and returns the first object of <code>name</code> it finds.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/awt/Container.html">Container</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#getAncestorOfClass(java.lang.Class, java.awt.Component)">getAncestorOfClass</A></B>(<A HREF="../../java/lang/Class.html">Class</A> c, <A HREF="../../java/awt/Component.html">Component</A> comp)</CODE><BR> Convenience method for searching above <code>comp</code> in the component hierarchy and returns the first object of class <code>c</code> it finds.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/awt/Component.html">Component</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#getDeepestComponentAt(java.awt.Component, int, int)">getDeepestComponentAt</A></B>(<A HREF="../../java/awt/Component.html">Component</A> parent, int x, int y)</CODE><BR> Returns the deepest visible descendent Component of <code>parent</code> that contains the location <code>x</code>, <code>y</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/awt/Rectangle.html">Rectangle</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#getLocalBounds(java.awt.Component)">getLocalBounds</A></B>(<A HREF="../../java/awt/Component.html">Component</A> aComponent)</CODE><BR> Return the rectangle (0,0,bounds.width,bounds.height) for the component <code>aComponent</code></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/awt/Component.html">Component</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#getRoot(java.awt.Component)">getRoot</A></B>(<A HREF="../../java/awt/Component.html">Component</A> c)</CODE><BR> Returns the root component for the current component tree.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../javax/swing/JRootPane.html">JRootPane</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#getRootPane(java.awt.Component)">getRootPane</A></B>(<A HREF="../../java/awt/Component.html">Component</A> c)</CODE><BR> If c is a JRootPane descendant return its JRootPane ancestor.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../javax/swing/ActionMap.html">ActionMap</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#getUIActionMap(javax.swing.JComponent)">getUIActionMap</A></B>(<A HREF="../../javax/swing/JComponent.html">JComponent</A> component)</CODE><BR> Returns the ActionMap provided by the UI in component <code>component</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../javax/swing/InputMap.html">InputMap</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#getUIInputMap(javax.swing.JComponent, int)">getUIInputMap</A></B>(<A HREF="../../javax/swing/JComponent.html">JComponent</A> component, int condition)</CODE><BR> Returns the InputMap provided by the UI for condition <code>condition</code> in component <code>component</code>.</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#getWindowAncestor(java.awt.Component)">getWindowAncestor</A></B>(<A HREF="../../java/awt/Component.html">Component</A> c)</CODE><BR> </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#invokeAndWait(java.lang.Runnable)">invokeAndWait</A></B>(<A HREF="../../java/lang/Runnable.html">Runnable</A> doRun)</CODE><BR> Causes <i>doRun.run()</i> to be executed synchronously on the AWT event dispatching thread.</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#invokeLater(java.lang.Runnable)">invokeLater</A></B>(<A HREF="../../java/lang/Runnable.html">Runnable</A> doRun)</CODE><BR> Causes <i>doRun.run()</i> to be executed asynchronously on the AWT event dispatching thread.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#isDescendingFrom(java.awt.Component, java.awt.Component)">isDescendingFrom</A></B>(<A HREF="../../java/awt/Component.html">Component</A> a, <A HREF="../../java/awt/Component.html">Component</A> b)</CODE><BR> Return <code>true</code> if a component <code>a</code> descends from a component <code>b</code></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#isEventDispatchThread()">isEventDispatchThread</A></B>()</CODE><BR> Returns true if the current thread is an AWT event dispatching thread.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#isLeftMouseButton(java.awt.event.MouseEvent)">isLeftMouseButton</A></B>(<A HREF="../../java/awt/event/MouseEvent.html">MouseEvent</A> anEvent)</CODE><BR> Returns true if the mouse event specifies the left mouse button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#isMiddleMouseButton(java.awt.event.MouseEvent)">isMiddleMouseButton</A></B>(<A HREF="../../java/awt/event/MouseEvent.html">MouseEvent</A> anEvent)</CODE><BR> Returns true if the mouse event specifies the middle mouse button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#isRectangleContainingRectangle(java.awt.Rectangle, java.awt.Rectangle)">isRectangleContainingRectangle</A></B>(<A HREF="../../java/awt/Rectangle.html">Rectangle</A> a, <A HREF="../../java/awt/Rectangle.html">Rectangle</A> b)</CODE><BR> Return true if <code>a</code> contains <code>b</code></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#isRightMouseButton(java.awt.event.MouseEvent)">isRightMouseButton</A></B>(<A HREF="../../java/awt/event/MouseEvent.html">MouseEvent</A> anEvent)</CODE><BR> Returns true if the mouse event specifies the right mouse button.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#layoutCompoundLabel(java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int)">layoutCompoundLabel</A></B>(<A HREF="../../java/awt/FontMetrics.html">FontMetrics</A> fm, <A HREF="../../java/lang/String.html">String</A> text, <A HREF="../../javax/swing/Icon.html">Icon</A> icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, <A HREF="../../java/awt/Rectangle.html">Rectangle</A> viewR, <A HREF="../../java/awt/Rectangle.html">Rectangle</A> iconR, <A HREF="../../java/awt/Rectangle.html">Rectangle</A> textR, int textIconGap)</CODE><BR> Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#layoutCompoundLabel(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int)">layoutCompoundLabel</A></B>(<A HREF="../../javax/swing/JComponent.html">JComponent</A> c, <A HREF="../../java/awt/FontMetrics.html">FontMetrics</A> fm, <A HREF="../../java/lang/String.html">String</A> text, <A HREF="../../javax/swing/Icon.html">Icon</A> icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, <A HREF="../../java/awt/Rectangle.html">Rectangle</A> viewR, <A HREF="../../java/awt/Rectangle.html">Rectangle</A> iconR, <A HREF="../../java/awt/Rectangle.html">Rectangle</A> textR, int textIconGap)</CODE><BR> Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/SwingUtilities.html#notifyAction(javax.swing.Action, javax.swing.KeyStroke, java.awt.event.KeyEvent, java.lang.Object, int)">notifyAction</A></B>(<A HREF="../../javax/swing/Action.html">Action</A> action, <A HREF="../../javax/swing/KeyStroke.html">KeyStroke</A> ks, <A HREF="../../java/awt/event/KeyEvent.html">KeyEvent</A> event, <A HREF="../../java/lang/Object.html">Object</A> sender, int modifiers)</CODE><BR> Invokes <code>actionPerformed</code> on <code>action</code> if <code>action</code> is enabled (and non null).</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#paintComponent(java.awt.Graphics, java.awt.Component, java.awt.Container, int, int, int, int)">paintComponent</A></B>(<A HREF="../../java/awt/Graphics.html">Graphics</A> g, <A HREF="../../java/awt/Component.html">Component</A> c, <A HREF="../../java/awt/Container.html">Container</A> p, int x, int y, int w, int h)</CODE><BR> Paint a component c on an abitrary graphics g in the specified rectangle, specifying the rectangle's upper left corner and size.</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#paintComponent(java.awt.Graphics, java.awt.Component, java.awt.Container, java.awt.Rectangle)">paintComponent</A></B>(<A HREF="../../java/awt/Graphics.html">Graphics</A> g, <A HREF="../../java/awt/Component.html">Component</A> c, <A HREF="../../java/awt/Container.html">Container</A> p, <A HREF="../../java/awt/Rectangle.html">Rectangle</A> r)</CODE><BR> Paint a component c on an abitrary graphics g in the specified rectangle, specifying a Rectangle object.</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#replaceUIActionMap(javax.swing.JComponent, javax.swing.ActionMap)">replaceUIActionMap</A></B>(<A HREF="../../javax/swing/JComponent.html">JComponent</A> component, <A HREF="../../javax/swing/ActionMap.html">ActionMap</A> uiActionMap)</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -