Results 1 to 2 of 2
  1. #1
    Sandworm is offline Member
    Join Date
    Nov 2009
    Posts
    2
    Rep Power
    0

    Default Issues with updating a canvas in Java

    Hi, guys. I'm having some serious problems with this, have been working on it for some time now - about 2 weeks - and I just can't see the issue I'm having here. Hopefully, a) Someone here can help me and b) This thread is in the right forum, I don't think it's particularly a basic program, but... hey, I could be wrong,. everything is relative.

    Anyhow, enough of my rambling. I'm having trouble with the code below, in that it doesn't want to update the world. In theory, when you click the up arrow, it should change to a different picture while the mouse is depressed on it. However, it does not re-render. I'm sure it's an obvious problem, I just can't figure it out, and I'd really appreciate a little help.

    I have tried to order the code in order of relevance, so hopefully if you see a problem in GameCanvas (which is where I am CERTAIN the problem is), you don't need to trawl through the rest. I have also attached my program, zipped from the eclipse project folder, just in case that's more helpful.

    Thanks to anyone who helps in advance.

    EDIT: I actually solved this myself, thank you. It was a simple case of using repaint() instead of update().
    Last edited by Sandworm; 11-19-2009 at 04:09 PM.

  2. #2
    Sandworm is offline Member
    Join Date
    Nov 2009
    Posts
    2
    Rep Power
    0

    Default

    Gone now, see above.
    Last edited by Sandworm; 11-19-2009 at 04:08 PM.

Similar Threads

  1. Replies: 0
    Last Post: 07-05-2009, 12:31 PM
  2. updating server side file using java bean
    By tskarthic in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 04-30-2009, 02:53 PM
  3. java program for updating bank details
    By java__beginner in forum New To Java
    Replies: 5
    Last Post: 03-12-2009, 03:42 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
  •