I am still curious, how often will you "change" the password text? Isn't it more likely that you will do it with "regular" JTextField's input? Why is the regular JTextField.getText() method returns a String then?
Yes, a String is immutable, but realistic speaking, you can still make String changes, it is just that it is less efficient because it really means that the program will allocate a new string whenever you make a change. So, I am still wondering why the Swing team decide to use char[] for the return value instead of String?
Most security system accept passwords as an array of chars. Strings are objects and setting an instance variable to null, which before referenced a passowrd String, would leave the password hanging around in memory until garbage collection.
Using an array of char allows you to properly clean up in iterating through the array and assigning an empty value for each char. This way no trace is left of the password that could otherwise show in a dump.
Frank