Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 13 of 13

Thread: URGENT: Please help me with my code!

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default URGENT: Please help me with my code!

    Solved, please delete this thread (I don't want my source files visible to anyone anymore). Thank you.
    Attached Files Attached Files


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,349
    Thanks
    49
    Thanked 2,204 Times in 2,177 Posts

    Default Re: URGENT: Please help me with my code!

    Please post the code you have questions about here on the forum.
    Be sure to wrap your code with code tags:
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.


    How have you tried debugging the code to see what it is doing?
    I add println statements to print out the values of variables to see what the computer sees as the code executes.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,332
    My Mood
    Hungover
    Thanks
    143
    Thanked 624 Times in 535 Posts

    Default Re: URGENT: Please help me with my code!

    This thread has been cross posted here:

    http://www.java-forums.org/advanced-java/66713-urgent-please-help-me-my-angry-birds-game.html

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting

    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    Junior Member
    Join Date
    Dec 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: URGENT: Please help me with my code!

    Solved, please close thread.

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,349
    Thanks
    49
    Thanked 2,204 Times in 2,177 Posts

    Default Re: URGENT: Please help me with my code!

    The posted code does not compile: Missing class Velocity

    Also there is no main() method for execution.
    If you don't understand my answer, don't ignore it, ask a question.

  6. #6
    Junior Member
    Join Date
    Dec 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: URGENT: Please help me with my code!

    Solved, please close thread.

  7. #7
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,349
    Thanks
    49
    Thanked 2,204 Times in 2,177 Posts

    Default Re: URGENT: Please help me with my code!

    I get this message: There is an IOException!

    All catch blocks should call the printStackTrace() method.
    If you don't understand my answer, don't ignore it, ask a question.

  8. #8
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 139 Times in 134 Posts

    Default Re: URGENT: Please help me with my code!

    Just eye-balling your code, you look to be calling Thread.sleep(...) on the Swing event thread and look to be using a loop that is effectively while (true), also on the Swing event thread, both of which will put your entire application to sleep, something I don't think you desire. If I am mis-understanding your code, please clarify. Please look at the tutorial on Concurrency in Swing for more details on the Swing event thread.

    Also for your next questions on this and other forums, please avoid using terms like "urgent" or ASAP. Remember that we're all volunteers, that no one likes to feel rushed, and that we strongly believe that *all* questions on this site are equally important, and that no question should be considered more urgent or important than the next. If you leave this out, and instead use an informative heading for your question, one that summarizes your problem, you'll likely get better help.

  9. #9
    Junior Member
    Join Date
    Dec 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: URGENT: Please help me with my code!

    Solved, please close thread.

  10. #10
    Junior Member
    Join Date
    Dec 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: URGENT: Please help me with my code!

    Quote Originally Posted by Norm View Post
    I get this message: There is an IOException!

    All catch blocks should call the printStackTrace() method.
    Sorry for double posting, but you're getting an IOException because the image files for the background and the bird are not in your directory. It would be much easier if you imported the .zip file I attached above into your IDE, as it contains these files.

  11. #11
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,349
    Thanks
    49
    Thanked 2,204 Times in 2,177 Posts

    Default Re: URGENT: Please help me with my code!

    I have it executing now. It looks like you need to learn how to debug your code to see why it is doing what it is doing. I debug code by adding lots of println statements that print out the values of important variables that control what the code is doing. It is an iterative process. By that I mean that as you see what the code is doing, it is often necessary to print out more information to learn more.
    Start with this:
    the bird just continues to go back to the slingshot
    What variables control the bird going back? How do their values change as the code executes?
    If you don't understand my answer, don't ignore it, ask a question.

  12. The Following User Says Thank You to Norm For This Useful Post:

    curmudgeon (December 18th, 2012)

  13. #12
    Junior Member
    Join Date
    Dec 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: URGENT: Please help me with my code!

    Solved, please close thread.

  14. #13
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,349
    Thanks
    49
    Thanked 2,204 Times in 2,177 Posts

    Default Re: URGENT: Please help me with my code!

    I just cannot relaunch it.
    Why not? What value of what variable controls the relaunch?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. My Code is not working [URGENT] Help Needed
    By abhijit@92 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 25th, 2012, 03:37 PM
  2. Need urgent help regarding java word wrap function.. URGENT
    By coldice in forum What's Wrong With My Code?
    Replies: 3
    Last Post: August 16th, 2011, 05:43 AM
  3. Need help with this code urgent please, i appreciate it.
    By joelmeler in forum What's Wrong With My Code?
    Replies: 3
    Last Post: July 30th, 2011, 09:11 PM
  4. URGENT Need help with code for billing
    By ab3lr in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 13th, 2011, 10:44 AM
  5. Urgent code needed
    By subhvi in forum AWT / Java Swing
    Replies: 4
    Last Post: August 27th, 2009, 12:55 AM