Results 1 to 4 of 4
  1. #1
    newb_tewb is offline Member
    Join Date
    Apr 2010
    Posts
    5
    Rep Power
    0

    Smile Need help with simple problem

    Java Code:
    String moneyLeftString = jLabel9.getText();
    long moneyLeft = Long.parseLong(moneyLeftString);
    
    if(moneyLeft > -1){
    jLabel31.setText("You have hit and you recieve" + withString() + " and " + withString());//shows both cards to player
    jLabel35.setText("The computer hits and recieves:" + withString());//Add hit and stand logic later..shows one card to player
     }
    else{
    jLabel31.setText("You have lost the game");//Informs the user of their fate
    - at the if statement : cannot find class moneyLeft,<identifier> expected
    -at the else statement : illegal start of type

  2. #2
    newb_tewb is offline Member
    Join Date
    Apr 2010
    Posts
    5
    Rep Power
    0

    Default

    a quick reply would definitley help at any time here guys..

  3. #3
    iluxa is offline Senior Member
    Join Date
    Mar 2010
    Posts
    266
    Rep Power
    5

    Default

    your code looks absolutely correct, perhaps you messed up with curly brackets somewhere above it?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    You bumped a thread after only 20 minutes?? I'm obviously way too late to help you, so I will keep any suggestions to myself. Sorry

Similar Threads

  1. I have a simple problem
    By o0oNorao0o in forum JCreator
    Replies: 20
    Last Post: 12-25-2009, 09:32 PM
  2. simple line problem / for loop problem
    By helpisontheway in forum New To Java
    Replies: 1
    Last Post: 11-17-2009, 07:12 AM
  3. a simple conversion problem
    By sweetjava in forum New To Java
    Replies: 3
    Last Post: 07-20-2009, 07:34 AM
  4. simple GUI problem
    By McChill in forum New To Java
    Replies: 4
    Last Post: 04-03-2009, 04:13 AM
  5. Simple IO problem
    By aamp in forum New To Java
    Replies: 2
    Last Post: 12-01-2008, 03:27 PM

Tags for this Thread

Posting Permissions

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