public static void SoloNumyLetras(java.awt.event.KeyEvent evt,javax.swing.JTextField txt){
    char caract;
        // Convierte TODO ingreso a mayusculas
        String letra = (evt.getKeyChar() + "").toUpperCase();
        evt.setKeyChar(letra.charAt(0));
        caract = evt.getKeyChar();

        if(!(caract >= 'A' && caract <= 'Z') && !(caract >= '0' && caract <= '9')&& (caract != ' ')){
                    evt.consume(); // ignorar el evento de teclado
                }
    }