titus.k.s: a few steps towards resolving your issue:
1. being directed to the api of JPassWordField (here)
2. reading the .getText description: (here)
and reading this part:
Deprecated. As of Java 2 platform v1.2, replaced by getPassword.
Fetches a portion of the text represented by the component. Returns an empty > string if length is 0.
For security reasons, this method is deprecated. Use the getPassword method > instead.
by pritaeas: Removed the linked post, so copied the contents here.