AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TextField con TextListener incrociati

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian)
View previous topic :: View next topic  
Author Message
CarMas
Guest





PostPosted: Tue Jun 20, 2006 7:25 pm    Post subject: TextField con TextListener incrociati Reply with quote



Espongo il mio problema quotidiano.
Ho due textfield (lavoro con awt) su cui vanno inseriti due numeri;
questi numeri pero' non sono scollegati ma dipendenti matematicamente
l'uno dall'altro. In pratica dato uno si trova l'altro, ma non si puo'
sapere a priori quale dei due inserire, ecco perche' mi servono due
textfield.
Per questo motivo ho associato ai textfield dei textlistener, con
l'intento che mentre scrivo in uno, lui mi "autocompleta" l'altro. Bene,
il problema e' che cosi' facendo, se scrivo in A lui mi imposta B
(usando il metodo setText) che pero' causa un evento al suo listener e
va a scrivere in A... e cosi' via senza fine.

A parte mettere il listener su uno solo dei due, al momento non ho altre
idee per risolvere la questione. Ho anche provato una (orribile)
soluzione di togliere temporaneamente il listener da uno mentre il
listener dell'altro lo modifica, ma non funziona.
Qualche consiglio?

Grazie
CarMas
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.