
Signature
Knute Johnson
email s/nospam/knute/
Thanks for the reply Knute.
Can you test the SelectedIndex in the InputVerifier?
((JTextField)cboYear.getEditor().getEditorComponent()).setInputVerifier(comboVerifier);
I don't believe so but I don't know Java well enough to say.
Let me ask this,
If you are writing a data entry application and want to validate a
users input after they enter a value into an editable JComboBox what
event would you say is the best to use?
One of the things I did in these combo boxes was to populate them with
CODE - DESCRIPTION values. I would like to allow them to type in the
code and then attempt to select the item for them from the value
entered. Sort of like, auto completion. That way they wouldn't have
to type the entire code-description value pair.
I also want to be sure that if they copy and paste into the editor my
event will catch it. I can, of course, do all this when the save
button is clicked but I would like to try it the other way too.
I appreciate your assistance and value your advice.
Sincerely,
Tim Frawley
Knute Johnson - 29 Dec 2005 03:56 GMT
> Thanks for the reply Knute.
>
[quoted text clipped - 3 lines]
>
> I don't believe so but I don't know Java well enough to say.
You will have to have a reference from outside of the InputVerifier I
would think.
> Let me ask this,
>
[quoted text clipped - 17 lines]
>
> Tim Frawley
If you want something to do auto-completion you might try writing a
special purpose Document and use that on a JTextField. The Document
methods can detect string insertions from either the keyboard or cut and
paste operations. I think that is where I would start anyway.

Signature
Knute Johnson
email s/nospam/knute/