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


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

Re: JFormattedTextField c

From "Eric Smith" <eric.smith@THRWHITE.remove-dii-this>
Subject Re: JFormattedTextField c
Message-ID <qhire4xqgu.fsf@ruckus.brouhaha.com> (permalink)
Newsgroups comp.lang.java.gui
References <eqvbbc$ilp$2@wblv-ip-nnrp-1.saix.net>
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?
And later I wrote:
> The JFormattedTextField apparently
> changes a "value" attribute when the field commits.
[...]
> 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.

Rogan Dawes <discard@dawes.za.net> writes:
> Use an ActionListener. But also see my response to your other mail.

Interesting.  The ActionListener fires if a return is pressed, but
not if a commit occurs because the focus is lost.  So if I use this
approach, I have to have both an ActionListener and a
PropertyChangeListener.

It seems bizarre that there's no easy way to get notification of
commits of a JFormattedTextField.  I think I'll take your other
advice and go back to using a JTable.

I think some of my complaints about using the JTable are solved if
instead of making my Memory class implement the AbstractTableModel, I
use a separate object for that, as you did in your HexForm class.

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