JavaTM 2 Platform
Standard Ed. 6

接口 javax.swing.event.CaretListener
的使用

使用 CaretListener 的软件包
javax.swing 提供一组“轻量级”(全部是 Java 语言)组件,尽量让这些组件在所有平台上的工作方式都相同。 
javax.swing.text 提供类 HTMLEditorKit 和创建 HTML 文本编辑器的支持类。 
 

javax.swingCaretListener 的使用
 

实现 CaretListenerjavax.swing 中的类
protected  class JEditorPane.AccessibleJEditorPane
          此类实现对 JEditorPane 类的可访问性支持。
protected  class JEditorPane.AccessibleJEditorPaneHTML
          此类提供了对 AccessibleHypertext 的支持,并且用于这类实例中:在此 JEditorPane 中安装的 EditorKit 是一个 HTMLEditorKit 实例。
protected  class JEditorPane.JEditorPaneAccessibleHypertextSupport
          AccessibleJEditorPaneHTML.getAccessibleText 返回的内容。
protected  class JPasswordField.AccessibleJPasswordField
          此类实现对 JPasswordField 类的可访问性支持。
protected  class JTextArea.AccessibleJTextArea
          此类实现对 JTextArea 类的可访问性支持。
protected  class JTextField.AccessibleJTextField
          此类实现对 JTextField 类的可访问性支持。
 

javax.swing.textCaretListener 的使用
 

实现 CaretListenerjavax.swing.text 中的类
 class JTextComponent.AccessibleJTextComponent
          此类实现 JTextComponent 类的可访问性支持。
 

返回 CaretListenerjavax.swing.text 中的方法
 CaretListener[] JTextComponent.getCaretListeners()
          返回在此文本组件上已注册的所有插入符侦听器的数组。
 

参数类型为 CaretListenerjavax.swing.text 中的方法
 void JTextComponent.addCaretListener(CaretListener listener)
          添加插入符侦听器,以便侦听任何插入符的更改通知。
 void JTextComponent.removeCaretListener(CaretListener listener)
          移除插入符侦听器。
 


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only