You are not calling the setText()
method on the correct variable. Use
jpwf.setText("");
instead of
pwd.setText("");
There is also another problem before that, you declare twice the variable jpwf
(once with JPasswordField
and once with String
). Maybe it's only a typo.
The error you get says that you have a variable jpwf
of the type String
on which there is no method named setText()
.