🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #7763

Re: focusLost & JTextField

#7763
From: John McGrath TeamB
Date: Fri, 15 Dec 2000 09:54
30 lines
2067 bytes
On 14 Dec 2000 12:34:36 -0800, Tulan wrote:

> I found out that I can use the !isTemporary() to get rid
> of the 2nd pop up MessageDialog box. 

I do not understand what you mean by "isTemporary()".  What object are 
you calling this method on?

> However, it pops up the error msg for me even I click
> the File/Exit menu item. Is there a way not to check the
> condition if I click a menu item? Or maybe I shall put
> my test in other event listner instead of the focusLost??
> Any suggestions?

It sounds like you are trying to verify the contents of a field when 
the user "leaves" the field.  In that case, you might want to look at 
the InputVerifier class that was added to Java 1.3.  I have heard that 
there are some problems with it, but it is designed for this purpose, 
and it has support for not running the input verifier when you lose 
focus to certain components like a "Cancel" button.  I do not know if 
you will be able to get that behavior with a menu item, though.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.14a3b0d9557d85e2989dc3@forums.borland.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!fr.clara.net!heighliner.fr.clara.net!news.imp.ch!news-zh.switch.ch!newsfeed-zh.ip-plus.net!news.ip-plus.net!bornews.borland.com!not-for-mail
References: <3a37f0a7_2@dnews> <MPG.14a24bebe19abe01989dbd@forums.borland.com> <3a38e79d$1_1@dnews> <3a392edc$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,d6ed4023ba0d7fb6
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2000-12-15 02:02:03 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!fr.clara.net!heighliner.fr.clara.net!news.imp.ch!news-zh.switch.ch!newsfeed-zh.ip-plus.net!news.ip-plus.net!bornews.borland.com!not-for-mail
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.swing
Subject: Re: focusLost & JTextField
Date: Fri, 15 Dec 2000 04:54:55 -0500
Organization: Another Netscape Collabra Server User
Lines: 30
Message-ID: <MPG.14a3b0d9557d85e2989dc3@forums.borland.com>
References: <3a37f0a7_2@dnews> <MPG.14a24bebe19abe01989dbd@forums.borland.com> <3a38e79d$1_1@dnews> <3a392edc$1_1@dnews>
NNTP-Posting-Host: dslcv1-60.fast.net
X-Newsreader: MicroPlanet Gravity v2.30