commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Ferguson <seansli...@comcast.net>
Subject Re: [JELLY] Key listeners
Date Tue, 22 Jul 2003 16:25:10 GMT
Hahahah, I didn't realize the embedded java code was jexl.  :)

I tried just adding my key listener and it didn't work.

Here is the code
  <textField var="customerId" action="${load}" text="" columns="10">
    ${addKeyListener(new JellyKeyAdapter())}
  </textField>

Where JellyKeyAdapter() is a class I have in the same directory as my 
jelly file.  Jexl complains of a parse error.

Paul Libbrecht wrote:

> I was meaning doing this entirely in java through jexl...
> If I remember well jcomponent.getActionMap() gives you an object which 
> you can enrich to put define new actions by their names (their "keys" in 
> the swing's javadoc parlance). You then bind these names to keystrokes 
> using jcomponent.getInputMap()...
> 
> Isn't it possible to do this in Jelly ?
> 
> Paul
> 
> 
> Sean Ferguson wrote:
> 
>>  From looking at the ActionTag source code, I am confused as to how 
>> I'd "fiddle with the actionMap and keymap."  Perhaps you can clarify 
>> that for me?
>>
>> Thanks
>>
>> Sean
>>
>> Paul Libbrecht wrote:
>>
>>> Sean Ferguson wrote:
>>>
>>>> Is there a way to add a key listener to a swing textField?  An 
>>>> action only gets called if an Enter is pressed, but I also want to 
>>>> catch other keypresses.
>>>
>>>
>>>
>>>
>>> Sean,
>>>
>>> I don't think KeyListeners are a good thing to use as they are very 
>>> low-level (hence may turn-out slow in Jelly I would fear). But an 
>>> action can be attached to any keypress for any Swing component. You 
>>> just have to fiddle with the actionMap and keymap (with names in the 
>>> middle).
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


Mime
View raw message