Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2492 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  InputMethodListener

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

InputMethodListener

n°345933
Gwarm
Posté le 27-03-2003 à 21:36:46  profilanswer
 

Quelqu'un aurait coder ça sans se taper toutes les définitions des interfaces et tout le toutim ? parce que dans la javadoc on me dit addInputMethodListener marche si getInputMethodRequests renvoie un InputMethodRequests, alors je commence à voir pour coder tout ça, et là il faudrait que je code toutes les méthodes de l'interface InputMethodRequests et je me dit : "Bwof, c'est juste pour un texte qui change, il y a qd meme pas 100 lignes de codes à taper !?!"
 
Mon but : avoir un Event lorsque le texte change dans un JTextField.
 
Merci bien.
 
PS : La methode qui m'intéresse est  
 

Code :
  1. void  inputMethodTextChanged(InputMethodEvent event)
  2. Invoked when the text entered through an input method has changed.


Message édité par Gwarm le 27-03-2003 à 21:42:19
mood
Publicité
Posté le 27-03-2003 à 21:36:46  profilanswer
 

n°346031
darklord
You're welcome
Posté le 27-03-2003 à 22:56:47  profilanswer
 

:heink:  Je ne saisis pas ton problème ...
 

Code :
  1. public class TonListener implements InputMethodListener {
  2.   public void caretPositionChanged(InputMethodEvent event) {
  3.   }
  4.   public  void inputMethodTextChanged(InputMethodEvent event) {
  5.      // Gerer event
  6.   }
  7. }


 
 

Code :
  1. TonListener tonListener = new TonListener();
  2. tonTextFiled.addInputMethodListener(tonListener);


---------------
Just because you feel good does not make you right
n°346651
Gwarm
Posté le 28-03-2003 à 15:27:43  profilanswer
 

Oui, c'est déjà ce que j'ai fait, je lui ai mis un "System.out.println("Action" );" et l'évènement n'est pas catché.
 
 

Code :
  1. public void addInputMethodListener(InputMethodListener l)
  2. Description copied from class: Component
  3. Adds the specified input method listener to receive input method events from this component. A component will only receive input method events from input methods if it also overrides getInputMethodRequests to return an InputMethodRequests instance. If listener l is null, no exception is thrown and no action is performed.


 
A component will only receive input method events from input methods if it also overrides getInputMethodRequests to return an InputMethodRequests instance.
 
Je n'ai quand même pas si mal traduit que ça.


Message édité par Gwarm le 28-03-2003 à 15:28:42
n°346702
bobuse
Posté le 28-03-2003 à 16:06:23  profilanswer
 

Je pige pas trop le pb, mais si ca peut t'aider :
 http://forum.hardware.fr/forum2.ph [...] h=&subcat=


---------------
get amaroK plugin
n°347018
darklord
You're welcome
Posté le 28-03-2003 à 23:11:49  profilanswer
 

GWaRm a écrit :

Oui, c'est déjà ce que j'ai fait, je lui ai mis un "System.out.println("Action" );" et l'évènement n'est pas catché.
 
 

Code :
  1. public void addInputMethodListener(InputMethodListener l)
  2. Description copied from class: Component
  3. Adds the specified input method listener to receive input method events from this component. A component will only receive input method events from input methods if it also overrides getInputMethodRequests to return an InputMethodRequests instance. If listener l is null, no exception is thrown and no action is performed.


 
A component will only receive input method events from input methods if it also overrides getInputMethodRequests to return an InputMethodRequests instance.
 
Je n'ai quand même pas si mal traduit que ça.


 
tu as regardé la source de JTextField? :o


---------------
Just because you feel good does not make you right
n°347132
Gwarm
Posté le 29-03-2003 à 12:27:06  profilanswer
 

J'ai pas le réflexe. Je vais voir ça


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  InputMethodListener

 

Sujets relatifs
Plus de sujets relatifs à : InputMethodListener


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)