KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quickserver > net > qsadmin > gui > EditFieldDocumentListener


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) 2003-2005 QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package org.quickserver.net.qsadmin.gui;
16
17 import java.awt.event.*;
18 import javax.swing.event.*;
19 import javax.swing.*;
20
21 public class EditFieldDocumentListener implements DocumentListener {
22     JButton saveButton;
23
24     public EditFieldDocumentListener(JButton saveButton) {
25         this.saveButton = saveButton;
26     }
27
28     public void insertUpdate(DocumentEvent e) {
29         if(saveButton!=null) saveButton.setEnabled(true);
30     }
31     public void removeUpdate(DocumentEvent e) {
32         if(saveButton!=null) saveButton.setEnabled(true);
33     }
34     public void changedUpdate(DocumentEvent e) {
35         //System.out.println(">>Change Update");
36
//if(saveButton!=null) saveButton.setEnabled(true);
37
}
38 }
39
40
Popular Tags