Re: JComboBox limit to list

From: ak (spam_at_imagero.com)
Date: 05/30/04


Date: Sun, 30 May 2004 02:27:17 +0200


> How can I make my editable Combo box limited to the items in the list
(like
> when using the LimitToList property in MS Access)?
> Not just making it highlight matching items in the list, but also refusing
> input that doesn't match the list entries?
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.

-- 
http://uio.dev.java.net
http://reader.imagero.com