Article View: borland.public.jbuilder.java.swing
Article #9549Help creating a JTextField that implements DocumentListener
From: Jeff Marendo
Date: Tue, 14 Mar 2000 00:00
Date: Tue, 14 Mar 2000 00:00
18 lines
1508 bytes
1508 bytes
Hello, I'm trying to create a JTextField that implements the DocumentListener interface. I'm not sure if this is what I even need to do based upon what I need. I need to be able to tell whether or not a user is entering in new data into a JTextField. There might already be data in a field displayed to the user, so that means the user could overwrite it and create a "dirty" state for this screen I'm working on. I need to track the dirty state, which I can do through a boolean variable, I'm sure. So far, I've made a class that extends JTextField and implements DocumentListener. I have print out statements within the changedUpdate, insertUpdate and removeUpdate methods. My constructors are: super( ), and super(text). I can use this class as is, but of course nothing happens, so I know I'm missing something but I don't know what it is. Any guesses at what I might be missing will be appreciated. Thanks. Jeff
Technical Details
Message-ID:
<8alphp$qv54@bornews.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c63a1a3a015cc9ed,start X-Google-Attributes: gid111d45,public From: "Jeff Marendo" <marendoj@commos.com> Subject: Help creating a JTextField that implements DocumentListener Date: 2000/03/14 Message-ID: <8alphp$qv54@bornews.borland.com> X-Deja-AN: 597403242 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Organization: CommTech Corporation X-MSMail-Priority: Normal Reply-To: "Jeff Marendo" <marendoj@commos.com> Newsgroups: borland.public.jbuilder.java.swing