Highlight not painting in JTextfield with with custom NavigationFilter
I recently added a custom NavigationFilter to a JTextField to prevent the user from moving into the leftmost 3 characters of the field, using the following NavigationFilter, which I set the field's NavigationFilter to after creating it
NavigationFilter EpNumFilter =new NavigationFilter(){
protectedint hdIndLen = Metadata.HD_CONTENT_PREFIX.length();
publicvoid setDot(
NavigationFilter.FilterBypass fb,int dot,
Position.Bias bias){
if (dot < hdIndLen){
fb.setDot(hdIndLen, bias);
}else{
fb.setDot(dot, bias);
}
}
publicvoid moveDot(
NavigationFilter.FilterBypass fb,int dot,
Position.Bias bias){
if (dot < hdIndLen){
fb.setDot(hdIndLen, bias);
}else{
fb.setDot(dot, bias);
}
}
};
For some reason, when click-dragging across the text in this field (ANY of it, not just the first 3 characters), the characters run across are not highlighted.
The same field, with the default NavigationFilter, works fine. Any suggestions?
Thanks,
Rich Stephens
Pathfire, Inc.
Any suggestions? Anything

