what is "Combo box" ? I know only JComboBox and Choice.
if you use JComboBox:
1) get Document of ComboBoxEditor Component:
JTextField jtf = (JTextField)JComboBox#getEditor()#getEditorComponent();
Document doc = jtf.getDocument();
2) use this Document to refuse unmatched input.

Signature
http://uio.dev.java.net
http://reader.imagero.com
> what is "Combo box" ? I know only JComboBox and Choice.
Yes, I'm thinking of JComboBox or a derived class of some sort.
> if you use JComboBox:
> 1) get Document of ComboBoxEditor Component:
> JTextField jtf = (JTextField)JComboBox#getEditor()#getEditorComponent();
> Document doc = jtf.getDocument();
>
> 2) use this Document to refuse unmatched input.
Didn't understand how to do this....
Document allow two listeners:
- DocumentListener
- UndoableEditListener
...but I don't se any way of cancelling the events in either of them.
Anyway, I did find code that does the job on the following page:
http://www.tutorials.de/tutorials75713.html

Signature
Josef Garvi
"Reversing desertification through drought tolerant trees"
http://www.eden-foundation.org/
new income - better environment - more food - less poverty
ak - 30 May 2004 13:30 GMT
> > 2) use this Document to refuse unmatched input.
>
> Didn't understand how to do this....
> Document allow two listeners:
> - DocumentListener
> - UndoableEditListener
you should write your own Document and override method insertString();

Signature
http://uio.dev.java.net
http://reader.imagero.com
Josef Garvi - 30 May 2004 13:30 GMT
> you should write your own Document and override method insertString();
Thanks.

Signature
Josef Garvi
"Reversing desertification through drought tolerant trees"
http://www.eden-foundation.org/
new income - better environment - more food - less poverty