Rieccomi

Devo limitare i caratteri inseribili in un JComboBox (un po' come ho fatto sui JTextField) ma c'č un problemino... JComboBox non ha setDocument e pertanto non posso usare questa classe:

codice:
        public class LimitedPlainDocument extends PlainDocument
        {

            private int maxSize;

            public LimitedPlainDocument(int maxSize)
            {
                this.maxSize = maxSize;
            }

            @Override
            public void insertString(int offs, String str, AttributeSet a)
                    throws BadLocationException
            {
                if (str == null)
                {
                    return;
                }

                if (offs + str.length() > maxSize)
                {
                    str = str.substring(0, maxSize - offs);
                }

                super.insertString(offs, str, a);
            }

        }
C'č modo di fare quello che chiedo? :master:
Ho provato a controllare il JComboEditor ma non c'č nulla :master:

Grazie