Results 1 to 4 of 4
  1. #1
    Beginner's Avatar
    Beginner is offline Member
    Join Date
    Apr 2010
    Posts
    25
    Rep Power
    0

    Default [Solved]Pls check why my code is giving a runtime error

    My code compiles ok, but I get errors during runtime. I already spent hours on it but can't seem to figure out why. It is an animation. At first the code ran ok, but there was flickering so I tried to remove it, but when I tried to follow isntructions and remove the flickering of the animation, it gave runtime errors.

    Here is WORKING CODE of the animation but with flicker:
    Java | import java.awt.*; import jav - Anonymous - 5VwLgwrx - Pastebin.com

    Here is code with RUNTIME ERRORS, with attempts to remove flicker:
    Java | import java.awt.*; import jav - Anonymous - Fix4t20V - Pastebin.com

    EDIT: eclipse said that errors were coming from the update() and paint() methods
    Last edited by Beginner; 05-25-2010 at 05:50 PM.

  2. #2
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    5

    Default

    You are getting NullPointerExceptions. Check your declaration of the Graphics object.
    Ever seen a dog chase its tail? Now that's an infinite loop.

  3. #3
    Beginner's Avatar
    Beginner is offline Member
    Join Date
    Apr 2010
    Posts
    25
    Rep Power
    0

    Default

    I don't see anything wrong with it =( any hints?

    EDIT: I noticed that init() method was not even called, do you know where I could call it?

    EDIT2: Nevermind, solved it myself...
    Last edited by Beginner; 05-25-2010 at 05:50 PM.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,446
    Rep Power
    25

Similar Threads

  1. can somebody check my code
    By raven in forum New To Java
    Replies: 2
    Last Post: 08-29-2010, 08:55 PM
  2. Replies: 22
    Last Post: 05-01-2010, 10:52 PM
  3. Replies: 5
    Last Post: 01-16-2010, 11:14 PM
  4. Plz Some one check my code
    By TamTam in forum AWT / Swing
    Replies: 1
    Last Post: 02-07-2009, 11:24 PM
  5. Replies: 3
    Last Post: 01-23-2009, 08:53 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
  •