I want to make component like JPasswordField that masks only part of an input, for example, for input 123456789, 12345**** will be rendered. I think that only correct way to do this is to override drawSelectedText() and drawUnselectedText() in component's View, but the problem with this approach is that I have to use TextUI from concrete look and feel (BasicPasswordFieldUI from AlexR's example) which might not work correctly when using some other lnf.
My problem is similar like one specified here
Any ideas on this? Is there some alternative to JTextField/JPasswordField that is more suitable for this job?
Thanks!