站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JavaTM 2 Platform Standard Edition 5.0 API 规范中文版

接口 javax.swing.event.DocumentListener 的使用 (Java 2 Platform SE 5.0) - JavaTM 2 Platform Standard Edition 5.0 API 规范中文版

JavaTM 2 Platform
Standard Ed. 5.0

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

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

javax.swing 中 DocumentListener 的使用
 

实现 DocumentListener 的 javax.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.text 中 DocumentListener 的使用
 

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

返回 DocumentListener 的 javax.swing.text 中的方法
 DocumentListener[] AbstractDocument.getDocumentListeners()
          返回在此文档上注册的所有文档侦听器的数组。
 

参数类型为 DocumentListener 的 javax.swing.text 中的方法
 void Document.addDocumentListener(DocumentListener listener)
          注册给定的观察者以便开始接收文档发生更改的通知。
 void AbstractDocument.addDocumentListener(DocumentListener listener)
          添加负责通知任何更改的文档侦听器。
 void DefaultStyledDocument.addDocumentListener(DocumentListener listener)
          添加负责通知任何更改的文档侦听器。
 void Document.removeDocumentListener(DocumentListener listener)
          将给定的观察者从通知列表中撤消注册,这样就不再接收改动更新。
 void AbstractDocument.removeDocumentListener(DocumentListener listener)
          移除文档侦听器。
 void DefaultStyledDocument.removeDocumentListener(DocumentListener listener)
          移除文档侦听器。
 


JavaTM 2 Platform
Standard Ed. 5.0

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。