Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Eric Smith" Subject: Re: JFormattedTextField c Message-ID: X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: References: Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 26 Date: Wed, 27 Apr 2011 15:30:23 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303918223 96.60.20.240 (Wed, 27 Apr 2011 10:30:23 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:30:23 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:927 To: comp.lang.java.gui I asked: > Is there some way for an object to get notified when > a JFormattedTextField commits? I've got part of the answer. The JFormattedTextField apparently changes a "value" attribute when the field commits. I can't find anywhere that this is documented; I found it by looking at the source code for the GNU Classpath implementation of JFormattedTextField, and experimentally determined that the Sun implementation does it as well. However, the getOldValue() and getNewValue() methods of the PropertyChangeEvent both return null, which seems broken. The bigger problem is that when using a MaskFormatter, the field doesn't seem to commit when return is pressed (and the contents are valid), though it does commit if it loses the focus because I click in a different field. Ugh. Any way to force it to commit on the return key? Thanks, Eric --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24