Reputation: 1
The following code written in netbeans it shows error as cannot find length()
method and invert if.im new to netbeans. please correct my code.thanks in advance.
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
if(jTextField1.getText().trim().length() == 0 && jPasswordField1.getPassword().length() == 0)
Upvotes: 0
Views: 143
Reputation: 240928
getPassword()
returns char[]
so use .length
field
jPasswordField1.getPassword().length
Also See
Upvotes: 2