Newbie question: how to have Action triggered by Enter key, and ComboBoxModel as inner class.

Alvaro Coronel <[email protected]> Sat, 23 Oct 2004 16:43:59 -0700 (PDT)
Newsgroups gmane.comp.embedded.carlsbad-cubes
Message-ID <[email protected]>
Hello there! 
I am experimenting with SwiXML, and find it eases and speeds up Swing GUI construction.
 
There are a couple of things I want to do and don't know how though:
 
One is to set up a ComboBox so that when it has focus and you press Enter, the current selected value is set and the next component gets the focus.
I am doing this in a non-SwiXML program like this:
 
docTypeCombo.addKeyListener( new KeyAdapter() { .... (here I set value & transfer focus) }
 
However, I haven't been able to figure out where to call addKeyListener() in my SwiXML program. I invariably get nullPointerExceptions when I try to. If I don't do that, the comboBox works OK (executing a specified AbstractAction) but doesn't respond to the Enter key.
 
The other thing I would like is not to have the ComboBoxModel in its own independent class. As I used the examples to build it, I now have a model file very similar to the ComboModel. ¿Would it be possible to use an inner class for this?
 
TIA
 
Álvaro.


		
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!

_______________________________________________
Forum mailing list
[email protected]
http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com