Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24
  1. #21
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,602
    Rep Power
    5

    Default Re: How does eclipse run its compiled programs?

    Load the images. And test and make certain they are loading okay. Loading from a Jar or within a directory may be different than loading from Eclipse. This is because in Eclipse, the appropriate environment variables may be different. In your paint method, don't try and paint anything until your image references are non-null. Then after you load the images, do a repaint(). Of course, this is just a guess. It's hard to help someone debug their code when you can't see it. Also, I assume you are catching all required exceptions and printing out the stack traces.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  2. #22
    Archeantus is offline Member
    Join Date
    May 2014
    Posts
    13
    Rep Power
    0

    Default Re: How does eclipse run its compiled programs?

    Well this is really weird. The images won't load when I execute the method to load all the images. Is there something that I messed up on? Code

  3. #23
    Archeantus is offline Member
    Join Date
    May 2014
    Posts
    13
    Rep Power
    0

    Default Re: How does eclipse run its compiled programs?

    Okay I found out the whole problem. So apparently I have a cannon image that i named with a Capital 'C'. In my code i used a lower case 'c'. apparently Eclipse doesn't care if you use caps or not for resources, but java does. I'm kicking myself right now.

  4. #24
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,602
    Rep Power
    5

    Default Re: How does eclipse run its compiled programs?

    I recommend you print out the return URL from the getResource invocation to see what is returning. Then you should try and read that file (outside of Eclipse) to see if there are any problems.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 18
    Last Post: 03-26-2014, 10:43 PM
  2. Need help with running programs in eclipse
    By HelloWorld1234 in forum New To Java
    Replies: 5
    Last Post: 06-12-2012, 03:49 PM
  3. Replies: 1
    Last Post: 12-07-2011, 07:39 PM
  4. Replies: 1
    Last Post: 04-27-2011, 10:08 AM
  5. Replies: 0
    Last Post: 08-04-2008, 12:17 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
  •