I am building a GUI where one textfield must be typed in latin characters, the others in arabic. To avoid switching the keyboard layout, I choosed to maintain it in arabic and use a DocumentFilter in that particular textfield to replace arabic characters with their counterpart according to a latin azerty layout. Example, if one types '\u0628' (it is 'ب'), this should be printed 'F' because in they are in same key. This worked fine with all characters except with the B key, which translates into I am building a GUI where one textfield must be