🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to interrupt focus events

#10968
From: CV
Date: Thu, 22 Jul 1999 00:00
32 lines
1638 bytes
See http://www.codeguru.com/java/articles/445.shtml

-CV



CV wrote:

> I'm writing a field-level validation function for JTextField components.
>
> The JTextField components are placed inside a JPanel container.
> When the JTextField is created, the programmer specifies the initial
> integer value, upper bound, and lower bound on this component.
> At runtime, the user can change the initial value.
> When focus is lost on this component, I validate whether or not the
> value in the component is within range.
> If not within range, I display a JOptionPane saying, "hey, your value is
> out of range".
>
> ---> What I want to do is return focus back to the component whose value
> is out of range.
> However, in my travels I am finding that I can neither
> 1) Interrupt the "focus_gained" event on the next component in the
> JPanel, nor
> 2) Return focus back to the component whose value was out of range.
>
> Any ideas?
>
> -Chris Vinson
> 408 577 2231
> If replying to me, please change the "TO" string to
> VinsonCL@PE-Nelson.com (not guest@guest.com)
Technical Details
Message-ID: <3797B117.974A4206@guest.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37960FC5.7AEF2343@guest.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,fbc5c4bd436d4432
X-Google-Attributes: gid111d45,public
From: CV <guest@guest.com>
Subject: Re: How to interrupt focus events
Date: 1999/07/22
Message-ID: <3797B117.974A4206@guest.com>
X-Deja-AN: 504205177
Content-Transfer-Encoding: 7bit
References: <37960FC5.7AEF2343@guest.com>
To: CV <guest@guest.com>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing