JavaTM 2 Platform
Standard Ed. 6

介面 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 DefaultStyledDocument.addDocumentListener(DocumentListener listener)
          添加負責通知任何更改的文檔偵聽器。
 void AbstractDocument.addDocumentListener(DocumentListener listener)
          添加負責通知任何更改的文檔偵聽器。
 void Document.addDocumentListener(DocumentListener listener)
          註冊給定的觀察者以便開始接收文檔發生更改的通知。
 void DefaultStyledDocument.removeDocumentListener(DocumentListener listener)
          移除文檔偵聽器。
 void AbstractDocument.removeDocumentListener(DocumentListener listener)
          移除文檔偵聽器。
 void Document.removeDocumentListener(DocumentListener listener)
          將給定的觀察者從通知列表中撤消註冊,這樣就不再接收改動更新。
 


JavaTM 2 Platform
Standard Ed. 6

提交錯誤或意見

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