title: how to empty the password field value(String) in java using swing
body: <p>I have Textfield and password field.I am able to get the string written in the textfield and password field but not able to setting the text of password field empty.</p>
  
  <p>The error comes "The method setText(String) is undefined for type string"</p>
  
  <pre><code>JTextField jtf=new JTextField(8);
  JPasswordField jpwf=new JPasswordField(8);
  String value= jtf.getText();
  String jpwf= jpwfName.getText();
  jtfName.setText("");
  **Error on this line**//jpwf.setText("");
  </code></pre>