int y, int p0, int p1) throws BadLocationException {
g.setColor(selected);
Container c = getContainer();
if (c instanceof JPasswordField) {
JPasswordField f = (JPasswordField) c;
if (! f.echoCharIsSet()) {
return super.drawSelectedText(g, x, y, p0, p1);
}
char echoChar = f.getEchoChar();
int n = p1 - p0;
for (int i = 0; i < n; i++) {