I know what the JPasswordField class does, and how/when to use it. This is not the question, just for clarity.
What I don't understand is why its functionality can't be part of JTextField: What problem would arise if they made getEchoChar/setEchoChar methods visible in the JTextField class? What exact situation they were trying to avoid in designing JTextField and JPasswordField as separated components?
In the docs, they say:
JTextField
...
The method setEchoChar and getEchoChar are not provided directly to avoid a new implementation of a pluggable look-and-feel inadvertently exposing password characters. To provide password-like services a separate class JPasswordField extends JTextField to provide this service with an independently pluggable look-and-feel.
and
JPasswordField
...
JPasswordField is intended to be source-compatible with java.awt.TextField used with echoChar set. It is provided separately to make it easier to safely change the UI for the JTextField without affecting password entries.
But I really was't able to understand what they mean (particularly in "avoid pluggable look-and-feel inadvertently exposing password characters").