所有类


javax.swing
类 JComponent

java.lang.Object
  继承者 java.awt.Component
      继承者 java.awt.Container
          继承者 javax.swing.JComponent
所有已实现的接口:
ImageObserver, MenuContainer, Serializable
直接已知子类:
AbstractButton, BasicInternalFrameTitlePane, Box, Box.Filler, JColorChooser, JComboBox, JFileChooser, JInternalFrame, JInternalFrame.JDesktopIcon, JLabel, JLayeredPane, JList, JMenuBar, JOptionPane, JPanel, JPopupMenu, JProgressBar, JRootPane, JScrollBar, JScrollPane, JSeparator, JSlider, JSpinner, JSplitPane, JTabbedPane, JTable, JTableHeader, JTextComponent, JToolBar, JToolTip, JTree, JViewport

public abstract class JComponent
   
   
   
   
   
extends Container
implements Serializable

该类是除顶层容器外所有 Swing 组件的基类。要使用继承自 JComponent 的组件,必须将该组件置于一个根为顶层 Swing 容器的包含层次结构(containment hierarchy)中。顶层 Swing 容器(如 JFrameJDialogJApplet)是专门的组件,它们为其他 Swing 组件提供了绘制其自身的场所。有关包含层次结构的解释,请参阅《The Java Tutorial》中的 Swing Components and the Containment Hierarchy 一节。

JComponent 类提供:

  • 使用 Swing 架构的标准组件和自定义组件的基类。
  • 可由程序员指定,或者由用户在运行时选择(可选)的“可插入外观”(L&F)。每个组件的外观都由 UI 委托 提供,这是一个继承自 ComponentUI 的对象。有关更多信息,请参阅《The Java Tutorial》中的 How to Set the Look and Feel 一节。
  • 全面的击键处理。有关更多信息,请参阅《The Swing Connection》中的文档 Keyboard Bindings in Swing
  • 对工具提示的支持:光标停留在组件时所弹出的简短描述。有关更多信息,请参阅《The Java Tutorial》中的 How to Use Tool Tips 一节。
  • 可访问性支持。JComponent 包含 Accessible 接口中的所有方法,但是它实际上不实现该接口。由扩展 JComponent 的每个类负责实现该接口。
  • 对特定于组件的属性的支持。通过 putClientProperty(java.lang.Object, java.lang.Object)getClientProperty(java.lang.Object) 方法,可以将名称 - 对象对与继承自 JComponent 的任意对象相关联。
  • 用于绘制的基础设施,包括双缓冲和对边框的支持。有关更多信息,请参阅《The Java Tutorial》中的 PaintingHow to Use Borders 章节。
有关这些主题的更多信息,请参阅 Swing package description 和《The Java Tutorial》中的 The JComponent Class 一节。

JComponent 及其子类记录了某些属性的默认值。例如,JTable 记录的默认行高为 16。每个具有 ComponentUIJComponent 子类都将创建该 ComponentUI 作为其构造方法的一部分。为了提供特定的外观,每个 ComponentUI 都可以在创建它的 JComponent 上设置各种属性。例如,自定义的外观可能要求 JTable 的行高为 24 。而所记录的默认值是安装 ComponentUI 前的属性值。如果需要为特定的属性使用具体值,则应该显式地设置它。

在版本 1.4 中,重新设计了焦点子系统。有关更多信息,请参阅《The Java Tutorial》中的 How to Use the Focus Subsystem 一节。

警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储,或适用于在运行相同 Swing 版本的应用程序之间进行 RMI(Remote Method Invocation,远程方法调用)。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder

另请参见:
KeyStroke, Action, setBorder(javax.swing.border.Border), registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int), JOptionPane, setDebugGraphicsOptions(int), setToolTipText(java.lang.String), setAutoscrolls(boolean)

嵌套类摘要
 classJComponent.AccessibleJComponent
          用于为可访问性提供默认支持的 JComponent 内部类。
 
从类 java.awt.Container 继承的嵌套类/接口
Container.AccessibleAWTContainer
 
从类 java.awt.Component 继承的嵌套类/接口
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
字段摘要
protected  AccessibleContextaccessibleContext
          与此 JComponent 关联的 AccessibleContext
protected  EventListenerListlistenerList
          此组件的事件侦听器列表。
static StringTOOL_TIP_TEXT_KEY
          光标经过组件时所显示的注释,也称为“值提示”、“相交提示”或“相交标签”。
protected  ComponentUIui
          此组件的外观委托。
static intUNDEFINED_CONDITION
          某些 API 使用的常量,意味着未定义条件。
static intWHEN_ANCESTOR_OF_FOCUSED_COMPONENT
          用于 registerKeyboardAction 的常量,意味着当接收组件是获得焦点的组件的祖先或者其本身就是获得焦点的组件时,应该调用该命令。
static intWHEN_FOCUSED
          用于 registerKeyboardAction 的常量,意味着在组件获得焦点时应该调用该命令。
static intWHEN_IN_FOCUSED_WINDOW
          用于 registerKeyboardAction 的常量,意味着当接收的组件处于拥有焦点的窗口内或者其本身就是获得焦点的组件时,应该调用命令。
 
从类 java.awt.Component 继承的字段
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
从接口 java.awt.image.ImageObserver 继承的字段
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
构造方法摘要
JComponent()
          默认的 JComponent 构造方法。
 
方法摘要
 voidaddAncestorListener(AncestorListener listener)
          注册 listener,这样当组件或其任意祖先移动,或者变得可见或不可见时该侦听器可接收 AncestorEvents
 voidaddNotify()
          通知此组件它现在已有了一个父组件。
 voidaddVetoableChangeListener(VetoableChangeListener listener)
          向侦听器列表添加一个 VetoableChangeListener
 voidcomputeVisibleRect(Rectangle visibleRect)
          返回该 Component 的“可见 rect 矩形”,即此组件及其所有祖先的可见矩形的交集。
 booleancontains(int x, int y)
          为了进行鼠标处理,让 UI 委托来定义此组件的精确形状。
 JToolTipcreateToolTip()
          返回用于显示工具提示的 JToolTip 实例。
 voiddisable()
          已过时。 从 JDK version 1.1 开始,由 java.awt.Component.setEnabled(boolean) 取代。
 voidenable()
          已过时。 从 JDK version 1.1 开始,由 java.awt.Component.setEnabled(boolean) 取代。
 voidfirePropertyChange(String propertyName, boolean oldValue, boolean newValue)
          支持报告 bound 属性的布尔属性的更改。
 voidfirePropertyChange(String propertyName, char oldValue, char newValue)
          报告 bound 属性的改变。
 voidfirePropertyChange(String propertyName, int oldValue, int newValue)
          支持报告 bound 属性的整数属性的更改。
protected  voidfireVetoableChange(String propertyName, Object oldValue, Object newValue)
          支持报告 constrained 属性的更改。
 AccessibleContextgetAccessibleContext()
          返回与此 JComponent 关联的 AccessibleContext
 ActionListenergetActionForKeyStroke(KeyStroke aKeyStroke)
          返回对象,该对象执行针对给定击键而注册的操作。
 ActionMapgetActionMap()
          返回用于确定为特定的 KeyStroke 绑定激发何种 ActionActionMap
 floatgetAlignmentX()
          重写 Container.getAlignmentX 以返回垂直对齐方式。
 floatgetAlignmentY()
          重写 Container.getAlignmentY 以返回水平对齐方式。
 AncestorListener[]getAncestorListeners()
          返回在此组件上注册的所有祖先侦听器的数组。
 booleangetAutoscrolls()
          获得 autoscrolls 属性。
 BordergetBorder()
          返回此组件的边框,如果当前未设置边框,则返回 null
 RectanglegetBounds(Rectangle rv)
          将此组件的边界存储到“返回值”rv 中并返回 rv
 ObjectgetClientProperty(Object key)
          返回具有指定键的属性值。
protected  GraphicsgetComponentGraphics(Graphics g)
          返回用于绘制此组件的 graphics 对象。
 JPopupMenugetComponentPopupMenu()
          返回为此组件分配的 JPopupMenu
 intgetConditionForKeyStroke(KeyStroke aKeyStroke)
          返回确定是否执行已注册动作 (action) 的条件,以响应指定的快捷键事件。
 intgetDebugGraphicsOptions()
          返回图形调试的状态。
static LocalegetDefaultLocale()
          返回在创建时,用于初始化每个 JComponent 的语言环境属性的默认语言环境。
 FontMetricsgetFontMetrics(Font font)
          获得指定 FontFontMetrics
 GraphicsgetGraphics()
          返回此组件的图形上下文,该上下文允许您绘制组件。
 intgetHeight()
          返回此组件的当前高度。
 booleangetInheritsPopupMenu()
          如果从父组件继承 JPopupMenu,则返回 true。
 InputMapgetInputMap()
          返回组件具有焦点时所使用的 InputMap
 InputMapgetInputMap(int condition)
          返回 condition 期间使用的 InputMap
 InputVerifiergetInputVerifier()
          返回此组件的输入校验器。
 InsetsgetInsets()
          如果已在此组件上设置了边框,则返回该边框的 insets;否则调用 super.getInsets
 InsetsgetInsets(Insets insets)
          返回包含此组件 inset 值的 Insets 对象。
<T extends EventListener>
T[]
getListeners(Class<T> listenerType)
          返回当前在此 JComponent 上注册为 FooListener 的所有对象组成的数组。
 PointgetLocation(Point rv)
          将此组件的 x,y 原点存储到“返回值”rv 中并返回 rv
 DimensiongetMaximumSize()
          如果已将最大大小设置为非 null 值,则返回该值。
 DimensiongetMinimumSize()
          如果已将最低大小设置为非 null 值,则返回该值。
 ComponentgetNextFocusableComponent()
          已过时。 从 1.4 版本开始,由 FocusTraversalPolicy 取代。
 PointgetPopupLocation(MouseEvent event)
          返回在此组件坐标系统中显示弹出式菜单的首选位置。
 DimensiongetPreferredSize()
          如果 preferredSize 已设置为非 null 值,则返回该值。
 KeyStroke[]getRegisteredKeyStrokes()
          返回启动已注册操作的 KeyStrokes
 JRootPanegetRootPane()
          返回此组件的 JRootPane 祖先。
 DimensiongetSize(Dimension rv)
          将此组件的宽度/高度存储到“返回值”rv 中并返回 rv
 PointgetToolTipLocation(MouseEvent event)
          返回工具提示在此组件坐标系统中的位置。
 StringgetToolTipText()
          返回通过 setToolTipText 所设置的工具提示字符串。
 StringgetToolTipText(MouseEvent event)
          返回用作 event 的工具提示的字符串。
 ContainergetTopLevelAncestor()
          返回此组件的顶层祖先(包含的 WindowApplet),如果尚未将此组件添加到任意容器中,则返回 null
 TransferHandlergetTransferHandler()
          获取 transferHandler 属性。
 StringgetUIClassID()
          返回用于查找 wing.plaf.ComponentUI 类(定义了此组件的外观)名称的 UIDefaults 键。
 booleangetVerifyInputWhenFocusTarget()
          返回值指示是否在此组件请求焦点前,为当前的焦点所有者调用输入校验器。
 VetoableChangeListener[]getVetoableChangeListeners()
          返回在此组件上注册的所有可否决更改侦听器的数组。
 RectanglegetVisibleRect()
          返回该 Component 的“可见矩形”,即此组件的可见矩形 new Rectangle(0, 0, getWidth(), getHeight()) 及其所有祖先的可见矩形的交集。
 intgetWidth()
          返回此组件的当前宽度。
 intgetX()
          返回组件原点的当前 x 坐标。
 intgetY()
          返回组件原点的当前 y 坐标。
 voidgrabFocus()
          请求此 Component 获得输入焦点,并且此 Component 的顶层祖先成为获得焦点的 Window。
 booleanisDoubleBuffered()
          返回此组件是否应该使用缓冲区进行绘制。
static booleanisLightweightComponent(Component c)
          如果此组件是轻量的(也就是它没有本机窗口系统同位体),则返回 true。
 booleanisManagingFocus()
          已过时。 从 1.4 版本开始,由 Component.setFocusTraversalKeys(int, Set)Container.setFocusCycleRoot(boolean) 取代。
 booleanisOpaque()
          如果此组件是完全不透明的,则返回 true。
 booleanisOptimizedDrawingEnabled()
          如果此组件平铺显示其子组件(也就是它可保证子组件不重叠),则返回 true。
 booleanisPaintingTile()
          如果该组件目前正在绘制 tile,则返回 true。
 booleanisRequestFocusEnabled()
          如果此 JComponent 应该获得焦点,则返回 true;否则返回 false
 booleanisValidateRoot()
          如果此方法返回 true,则此组件的子组件调用 revalidate 将导致对从此根开始的整棵树进行验证。
 voidpaint(Graphics g)
          由 Swing 调用,以绘制组件。
protected  voidpaintBorder(Graphics g)
          绘制组件的边框。
protected  voidpaintChildren(Graphics g)
          绘制此组件的子组件。
protected  voidpaintComponent(Graphics g)
          如果 UI 委托为非 null,则调用该 UI 委托的 paint 方法。
 voidpaintImmediately(int x, int y, int w, int h)
          立即绘制此组件及其子组件中与该区域重叠的指定区域。
 voidpaintImmediately(Rectangle r)
          立即绘制指定的区域。
protected  StringparamString()
          返回此 JComponent 的字符串表示形式。
 voidprint(Graphics g)
          调用此方法以打印组件。
 voidprintAll(Graphics g)
          调用此方法以打印组件。
protected  voidprintBorder(Graphics g)
          打印该组件的边框。
protected  voidprintChildren(Graphics g)
          打印此组件的子组件。
protected  voidprintComponent(Graphics g)
          在打印操作期间调用此方法。
protected  voidprocessComponentKeyEvent(KeyEvent e)
          处理该组件本身可识别的所有键事件。
protected  booleanprocessKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed)
          调用此方法,以处理由于 KeyEvente 而针对 ks 的键绑定。
protected  voidprocessKeyEvent(KeyEvent e)
          重写 processKeyEvent 以处理事件。
protected  voidprocessMouseEvent(MouseEvent e)
          处理此组件上发生的鼠标事件,方法是将其调度到任意已注册的 MouseListener 对象,有关此方法的完整描述,请参阅 Component.processMouseEvent(MouseEvent)
protected  voidprocessMouseMotionEvent(MouseEvent e)
          处理鼠标移动事件,如 MouseEvent.MOUSE_DRAGGED。
 voidputClientProperty(Object key, Object value)
          向此组件添加任意的键/值“客户端属性”。
 voidregisterKeyboardAction(ActionListener anAction, KeyStroke aKeyStroke, int aCondition)
          此方法现在已过时,对于类似的操作,请结合使用 getActionMap()getInputMap()
 voidregisterKeyboardAction(ActionListener anAction, String aCommand, KeyStroke aKeyStroke, int aCondition)
          此方法现在已过时,对于类似的操作,请结合使用 getActionMap()getInputMap()
 voidremoveAncestorListener(AncestorListener listener)
          注销 listener,使其不再接收 AncestorEvents
 voidremoveNotify()
          通知此组件它不再有父组件。
 voidremoveVetoableChangeListener(VetoableChangeListener listener)
          从侦听器列表移除一个 VetoableChangeListener
 voidrepaint(long tm, int x, int y, int width, int height)
          如果要显示组件,则将指定的区域添加到脏区 (dirty region) 列表。
 voidrepaint(Rectangle r)
          如果要显示该组件,则将指定的区域添加到脏区列表。
 booleanrequestDefaultFocus()
          已过时。 从 1.4 版本开始,由 FocusTraversalPolicy.getDefaultComponent(Container).requestFocus() 取代
 voidrequestFocus()
          请求此 Component 获得输入焦点。
 booleanrequestFocus(boolean temporary)
          请求此 Component 获得输入焦点。
 booleanrequestFocusInWindow()
          请求此 Component 获得输入焦点。
protected  booleanrequestFocusInWindow(boolean temporary)
          请求此 Component 获得输入焦点。
 voidresetKeyboardActions()
          取消首层 InputMapsActionMap 中的所有绑定。
 voidreshape(int x, int y, int w, int h)
          已过时。 从 JDK 5 开始,由 Component.setBounds(int, int, int, int) 取代。

移动此组件并调整其大小。

 voidrevalidate()
          支持推迟的自动布局。
 voidscrollRectToVisible(Rectangle aRect)
          将 scrollRectToVisible() 消息转发到 JComponent 的父组件。
 voidsetActionMap(ActionMap am)
          将 ActionMap 设置为 am
 voidsetAlignmentX(float alignmentX)
          设置垂直对齐方式。
 voidsetAlignmentY(float alignmentY)
          设置水平对齐方式。
 voidsetAutoscrolls(boolean autoscrolls)
          设置 autoscrolls 属性。
 voidsetBackground(Color bg)
          设置此组件的背景色。
 voidsetBorder(Border border)
          设置此组件的边框。
 voidsetComponentPopupMenu(JPopupMenu popup)
          设置此 JComponentJPopupMenu
 voidsetDebugGraphicsOptions(int debugOptions)
          启用或禁用与组件或其某个子组件内执行的每个图形操作有关的诊断信息。
static voidsetDefaultLocale(Locale l)
          设置在创建时,用于初始化每个 JComponent 的语言环境属性的默认语言环境。
 voidsetDoubleBuffered(boolean aFlag)
          设置此组件是否应该使用缓冲区进行绘制。
 voidsetEnabled(boolean enabled)
          设置是否启用此组件。
 voidsetFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)
          设置针对此 Component 的给定遍历操作的焦点遍历键。
 voidsetFont(Font font)
          设置此组件的字体。
 voidsetForeground(Color fg)
          设置此组件的前景色。
 voidsetInheritsPopupMenu(boolean value)
          设置如果此组件确实没有已分配的 JPopupMenu,那么 getComponentPopupMenu 是否应该委托给其父级。
 voidsetInputMap(int condition, InputMap map)
          设置在 mapcondition 条件下要使用的 InputMap
 voidsetInputVerifier(InputVerifier inputVerifier)
          设置此组件的输入校验器。
 voidsetMaximumSize(Dimension maximumSize)
          将此组件的最大大小设置为一个常量值。
 voidsetMinimumSize(Dimension minimumSize)
          将此组件的最低大小设置为一个常量值。
 voidsetNextFocusableComponent(Component aComponent)
          已过时。 从 1.4 版本开始,由 FocusTraversalPolicy 取代
 voidsetOpaque(boolean isOpaque)
          如果为 true,则该组件绘制其边界内的所有像素。
 voidsetPreferredSize(Dimension preferredSize)
          设置此组件的首选大小。
 voidsetRequestFocusEnabled(boolean requestFocusEnabled)
          提供一个关于此 JComponent 是否应该获得焦点的提示。
 voidsetToolTipText(String text)
          注册要在工具提示中显示的文本。
 voidsetTransferHandler(TransferHandler newHandler)
          设置 transferHandler 属性,如果该组件不支持数据传输操作,则为 null
protected  voidsetUI(ComponentUI newUI)
          设置此组件的外观委托。
 voidsetVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget)
          设置该值以指示是否在此组件请求焦点前,为当前的焦点所有者调用输入校验器。
 voidsetVisible(boolean aFlag)
          使该组件可见或不可见。
 voidunregisterKeyboardAction(KeyStroke aKeyStroke)
          此方法现在已过时。
 voidupdate(Graphics g)
          调用 paint
 voidupdateUI()
          将 UI 属性重置为当前外观的值。
 
从类 java.awt.Container 继承的方法
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
从类 java.awt.Component 继承的方法
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

ui

protected transient ComponentUI ui
此组件的外观委托。


listenerList

protected EventListenerList listenerList
此组件的事件侦听器列表。


WHEN_FOCUSED

public static final int WHEN_FOCUSED
用于 registerKeyboardAction 的常量,意味着在组件获得焦点时应该调用该命令。

另请参见:
常量字段值

WHEN_ANCESTOR_OF_FOCUSED_COMPONENT

public static final int WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
用于 registerKeyboardAction 的常量,意味着当接收组件是获得焦点的组件的祖先或者其本身就是获得焦点的组件时,应该调用该命令。

另请参见:
常量字段值

WHEN_IN_FOCUSED_WINDOW

public static final int WHEN_IN_FOCUSED_WINDOW
用于 registerKeyboardAction 的常量,意味着当接收的组件处于拥有焦点的窗口内或者其本身就是获得焦点的组件时,应该调用命令。

另请参见:
常量字段值

UNDEFINED_CONDITION

public static final int UNDEFINED_CONDITION
某些 API 使用的常量,意味着未定义条件。

另请参见:
常量字段值

TOOL_TIP_TEXT_KEY

public static final String TOOL_TIP_TEXT_KEY
光标经过组件时所显示的注释,也称为“值提示”、“相交提示”或“相交标签”。

另请参见:
常量字段值