Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #927

Re: JFormattedTextField c

From "Eric Smith" <eric.smith@THRWHITE.remove-dii-this>
Subject Re: JFormattedTextField c
Message-ID <qhejotvy8n.fsf@ruckus.brouhaha.com> (permalink)
Newsgroups comp.lang.java.gui
References <qhr6st3w0m.fsf@ruckus.brouhaha.com>
Date 2011-04-27 15:30 +0000
Organization TDS.net

Show all headers | View raw


  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

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

JFormattedTextField commi "Eric Smith" <eric.smith@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
  Re: JFormattedTextField c "Eric Smith" <eric.smith@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
    Re: JFormattedTextField c "Rogan Dawes" <rogan.dawes@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
      Re: JFormattedTextField c "Eric Smith" <eric.smith@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
      Re: JFormattedTextField c "Eric Smith" <eric.smith@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
        Re: JFormattedTextField c "Rogan Dawes" <rogan.dawes@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
          Re: JFormattedTextField c "Eric Smith" <eric.smith@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
            Re: JFormattedTextField c "Rogan Dawes" <rogan.dawes@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
              Re: JFormattedTextField c "Eric Smith" <eric.smith@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
  Re: JFormattedTextField c "Ian Wilson" <ian.wilson@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
    Re: JFormattedTextField c "Eric Smith" <eric.smith@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000

csiph-web