🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Events ...

#12002
From: Karsten B�lge
Date: Fri, 05 Mar 1999 00:00
43 lines
1868 bytes
>I have an problem with Event-handling.
>
>I have an dialog. In this dialog are some elements - especially a
>text-field. When this textfiled LOOSES the focus some
>event-handling-code (some checkings) is executed.
>
>There is an OK-Button too that closes the dialog ...
>
>Now I have the following problem.
>After editing the textfield there are two possibilities :
>
>1.) You edit an other field. That means that the event-checking-code is
>executed and everything is ok.
>
>2.) But when you click on the Ok-Button when the textfield still have
>the focus the it is not said which event-code is executed first.
>Some times the event-code from the field is executed and after this the
>button, but some times the button-code is executed first and then the
>text-field-code.
>
>I need it in the first sequence - FIRST the textfield-event-code and
>THEN the Button. This is because the textfield maybe gets changed in its
>event-code ...
>
>Any ideas out there ??
>
>Greetings
>
>Ingo
>--


If you instead of using a FocusLostEvent to verify the input, uses a
TextValueChanged, you will evaluate the Text rigth after it has been
entered, and not when the TextField lost focus; something like this

TextFieldControl.addTextListener(new java.awt.event.TextListener()
 {public void textValueChanged(TextEvent e) {
    TextFieldEvalution();
    }
});

Karsten Bolge
Technical Details
Message-ID: <7bomc7$6ff11@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36C2C3CA.13192CAF@apollon.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,eec34355b45edec4
X-Google-Attributes: gid111d45,public
From: "Karsten B�lge" <KUB@i-data.com>
Subject: Re: Events ...
Date: 1999/03/05
Message-ID: <7bomc7$6ff11@forums.borland.com>
X-Deja-AN: 451557895
References: <36C2C3CA.13192CAF@apollon.de>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: i-data international a-s
Newsgroups: borland.public.jbuilder.java.swing