public static DefaultFormatterFactory creaFormatoControl(int tipo, 
                                        int cantEnt, int cantFra, char caracter){
        DefaultFormatterFactory factory = null;
        MaskFormatter numcase = null;
        String cadena = "";
        int i;
                
        for(i=0;i<cantEnt;i++){
            cadena = cadena + "#";
        }
        if(cantFra > 0){
            cadena = cadena + ".";
            for(i=0;i<cantFra;i++){
                cadena = cadena + "#";
            }
        }
        switch(tipo){
            case 1:
                try {
                    numcase = new MaskFormatter(cadena);
                    numcase.setPlaceholderCharacter(caracter);   
                    numcase.setOverwriteMode(true);   
                    numcase.setValidCharacters("0123456789");               
                    factory = new DefaultFormatterFactory(numcase);                    
                }catch (Exception pe) {
                    Base.mostrar("Error al dar Formato de Numero Entero");
                }
                break;
            case 2:
                try {
                    numcase = new MaskFormatter(cadena);
                    numcase.setPlaceholderCharacter(caracter);   
                    numcase.setOverwriteMode(true);   
                    numcase.setValidCharacters("0123456789");       
                    factory = new DefaultFormatterFactory(numcase);                    
                }catch (Exception pe) {
                    Base.mostrar("Error al dar Formato de Numero Real");
                }
                break;
        }
        
        return factory;
    }