Example usage for javax.swing.text Document addDocumentListener

List of usage examples for javax.swing.text Document addDocumentListener

Introduction

In this page you can find the example usage for javax.swing.text Document addDocumentListener.

Prototype

public void addDocumentListener(DocumentListener listener);

Source Link

Document

Registers the given observer to begin receiving notifications when changes are made to the document.

Usage

From source file:org.richie.codeGen.ui.CodeGenMainUI.java

public JPanel getWestPanel() {
    if (westPanel == null) {
        westPanel = new JPanel();
        westPanel.setLayout(new BorderLayout());
        JLabel filterLable = new JLabel("");
        JPanel filterPanel = new JPanel();
        filterPanel.add(filterLable);//from w  w  w .  ja v a2 s.c  om
        filterField = new JTextField(15);
        Document doc = filterField.getDocument();
        doc.addDocumentListener(new TextDocumentListener());
        filterPanel.add(filterField);
        filterPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
        westPanel.setPreferredSize(new Dimension(200, 650));// ?,JPanel
        westPanel.add(filterPanel, BorderLayout.NORTH);
        westPanel.add(getTreepanel(), BorderLayout.CENTER);
    }
    return westPanel;
}