Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By Dark

Thread: What is wrong with that code ?!

  1. #1
    qwerty53's Avatar
    qwerty53 is offline Member
    Join Date
    Jul 2011
    Posts
    32
    Rep Power
    0

    Exclamation What is wrong with that code ?!

    is that the problem "missing symbol" ?



    Java Code:
         private void txtPasswordActionPerformed(java.awt.event.ActionEvent evt) {                                         
          String password = txtPassword.getText().trim();   
          int passwordLenght = password.lenght();              
          if( passwordLenght != 8 ) {
          JOptionPane.showMessageDialog(null, "your password must be 8 characters!..");
          txtPassword.requestFocus();
          }                                        
          }
    Last edited by qwerty53; 07-12-2011 at 11:58 AM. Reason: bad grammar

  2. #2
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    Could you post the full error message? It tells you what line the error occured on.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  3. #3
    qwerty53's Avatar
    qwerty53 is offline Member
    Join Date
    Jul 2011
    Posts
    32
    Rep Power
    0

    Default

    Java Code:
       private void txtPasswordActionPerformed(java.awt.event.ActionEvent evt) {                                         
          String password = txtPassword.getText().trim();   
          int passwordLenght = password.lenght();                /* the orror message is right here. and it says "cannot find symbol"/
          if( passwordLenght != 8 ) {
          JOptionPane.showMessageDialog(null, "your password must be 8 characters!..");
          txtPassword.requestFocus();
          }                                        
          }

  4. #4
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    How do you spell length?
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  5. #5
    qwerty53's Avatar
    qwerty53 is offline Member
    Join Date
    Jul 2011
    Posts
    32
    Rep Power
    0

    Default

    i'm new in java and in english.. i have realized that 15 minutes ago.. thanks for help..

  6. #6
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    Its alright, when it gives you an error that points out the line it is always a good thing to look at the code. Double check your spelling of things, because a simple letter swap-a-roo can really mess up your code.
    qwerty53 likes this.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

Similar Threads

  1. What is wrong with this code?
    By Mythreadings in forum New To Java
    Replies: 38
    Last Post: 11-19-2010, 01:43 AM
  2. What Could be Wrong with This code????
    By Manfizy in forum New To Java
    Replies: 9
    Last Post: 08-22-2010, 12:28 PM
  3. What is wrong with my code?!
    By new2java2009 in forum New To Java
    Replies: 2
    Last Post: 04-17-2010, 09:01 PM
  4. What is wrong with this code
    By rosh72851 in forum New To Java
    Replies: 13
    Last Post: 10-31-2008, 02:50 AM
  5. What's wrong with this code?
    By Wizard wusa in forum New To Java
    Replies: 14
    Last Post: 01-23-2008, 12:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •