On Dec 13, 9:27 am, googlegroupsspamfil...@alister.info wrote:
> Is there a way to set an editable JComboBox to only allow one
> character to be entered? I can do it in a JTextField by extending
> PlainDocument and setting it to the document on the control but
> JComboBox has no setDocument().
Sorted it. A JComboBox can be cast to a JTextField like this:
((JTextField) this.getEditor().getEditorComponent()).setDocument(new
JComboBoxLimitDoc(1));