Fazer JComboBox Aceitar Somente Maiusculas e Com Numero Maximo de Caracteres

Ola pessoal tudo bem, espero que sim.
To Aqui tentando desenvolver um JComboBox que aceite somente Maiusculas e com um MaxLenght tambem, eu tenho um exemplo aqui que eu implementei em um JTextField mais to tentando fazer o mesmo no JComboBox e ele nao aceita, tem alguma coisa a ver com o Override, obrigado a todos

Segue a classe JTextField Maiuscula e com MaxLength :

public class JTextLimitado extends JTextField{
    
    @Override
    protected Document createDefaultModel() {
        return new LimitedCaseDocument();
    }
    

    private final class LimitedCaseDocument extends PlainDocument {

        @Override
        public void insertString(int offs, String str, AttributeSet a)
                throws BadLocationException {

            int iMaxLength = getColumns();

            if (str == null) {
                return;
            }

            char[] upper = str.toCharArray();
            for (int i = 0; i < upper.length; i++) {
                upper[i] = Character.toUpperCase(upper[i]);
            }
            str = new String(upper);

            if (iMaxLength <= 0) { // aceitara qualquer no. de caracteres
                super.insertString(offs, str, a);
                return;
            }

            int ilen = (getLength() + str.length());
            if (ilen <= iMaxLength) { // se o comprimento final for menor...
                super.insertString(offs, str, a);   // ...aceita str
            } else {
                if (getLength() == iMaxLength) {
                    return; // nada a fazer
                }
                String newStr = str.substring(0, (iMaxLength - getLength()));
                super.insertString(offs, newStr, a);
            }
        }
    }
}

Valeu Pessoal um Abraco a Todos.

está gerando algum erro? Cole aí o stacktrace se estiver

Colega nao gera nenhum erro e que estou tentando criar uma classe JComboLimitado extends JComboBox e nao esta funcionando nao.

Eis a Classe:

public class JComboLimitado extends JComboBox {
    
 @Override
    protected Document createDefaultModel() {
        return new JComboLimitado.LimitedCaseDocument();
    }
    

    private final class LimitedCaseDocument extends PlainDocument {

        @Override
        public void insertString(int offs, String str, AttributeSet a)
                throws BadLocationException {

            int iMaxLength = 30;

            if (str == null) {
                return;
            }

            char[] upper = str.toCharArray();
            for (int i = 0; i < upper.length; i++) {
                upper[i] = Character.toUpperCase(upper[i]);
            }
            str = new String(upper);

            if (iMaxLength <= 0) { // aceitara qualquer no. de caracteres
                super.insertString(offs, str, a);
                return;
            }

            int ilen = (getLength() + str.length());
            if (ilen <= iMaxLength) { // se o comprimento final for menor...
                super.insertString(offs, str, a);   // ...aceita str
            } else {
                if (getLength() == iMaxLength) {
                    return; // nada a fazer
                }
                String newStr = str.substring(0, (iMaxLength - getLength()));
                super.insertString(offs, newStr, a);
            }
        }
    }
    
}

O Problema ocorre no primeiro Override o complilador diz o seguinte :
metthod does not override or implement a method form a supertype

Veja, na annotation @Override vc está afirmando ao compilador que o método createDefaultModel() está sobrescrevendo o método em questão…
Mas a classe JComboBox não possui esse método…

Agradeco mais uma vez amigos, onde encontro esta annotations por favor ?

Nas linhas 3 e 11 do código que você postou.

http://docs.oracle.com/javase/tutorial/java/javaOO/annotations.html