Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Help!!!

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help!!!

    I copied this code from school and it says that ...
    public void itemStateChanged(ItemEvent it) has illegal start of expression and ';' expected could someone please tell me how to fix it



    }
    public void itemStateChanged(ItemEvent it)
    {
    if(it.getSource()==chkPencil)
    {
    intPencilCounter += 1;
    dblPencilTotal=dblPencilPrice*intpencilCounter;
    txaUserThings.serTexr("Pencils price: $" + dblPencilTotal +"\nNumber of pencils ordered "
    + intPencilCounter + "\n" + "\n");
    }

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,171
    Thanks
    203
    Thanked 2,549 Times in 2,527 Posts
    1) This is the JavaScript forum. Java and Javascript are entirely different programming languages, in spite of the confusingly similar names.

    2) Do please read the posting guidelines regarding silly thread titles. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose.

    3) Please read the sticky about using <code> tags.

  • #3
    Registered User
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Whoops

    I am greatly sorry for my actions and would like to apologize to those who were offended in the process and I would also like to apologize to any women or children who found this content offensive and I am truely sorry and am aware of any consequences that might come my way and I take full responsibility for my selfish actions.

  • #4
    New Coder
    Join Date
    Jan 2009
    Location
    vegas baby!
    Posts
    15
    Thanks
    4
    Thanked 0 Times in 0 Posts
    gee... bet their lining up to help out now... lol


    from
    (another new guy)

  • #5
    WA
    WA is offline
    Administrator
    Join Date
    Mar 2002
    Posts
    2,596
    Thanks
    2
    Thanked 19 Times in 18 Posts
    It's ok Gabwit, newcomer's mistake. I've moved your thread to the correct Java forum.
    - George
    - JavaScript Kit- JavaScript tutorials and 400+ scripts!
    - JavaScript Reference- JavaScript reference you can relate to.

  • #6
    Regular Coder DELOCH's Avatar
    Join Date
    Apr 2006
    Location
    Canada
    Posts
    537
    Thanks
    4
    Thanked 2 Times in 2 Posts
    all statements end with ;, starting a new line in a middle of the statement is illegal(although i believe there is a way to do this, but i don't remember what symbol signifies that the line is continued on the next line \ parhaps)

    either way, do not start a new line in the middle of ur statements and always end statements with ';'



  •  

    Posting Permissions

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