Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 58784 invoked from network); 22 Jul 2003 16:25:12 -0000 Received: from rwcrmhc11.comcast.net (204.127.198.35) by daedalus.apache.org with SMTP; 22 Jul 2003 16:25:12 -0000 Received: from comcast.net (unknown[65.116.140.118](misconfigured sender)) by comcast.net (rwcrmhc11) with SMTP id <2003072216251401300og99ae> (Authid: ferguson.sean); Tue, 22 Jul 2003 16:25:14 +0000 Message-ID: <3F1D6566.50306@comcast.net> Date: Tue, 22 Jul 2003 09:25:10 -0700 From: Sean Ferguson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: [JELLY] Key listeners References: <3F1876F5.3000401@comcast.net> <3F1B2D11.7090809@activemath.org> <3F1C1BA6.5040306@comcast.net> <3F1C61D9.7080002@activemath.org> In-Reply-To: <3F1C61D9.7080002@activemath.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 ${addKeyListener(new JellyKeyAdapter())} 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 > >