Page 2 of 2 FirstFirst 12
Results 21 to 27 of 27
  1. #21
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Default

    Okey, now my errors ain't that many, but they're still some:

    Exception in thread "main" java.lang.IllegalArgumentException: input == null!
    at javax.imageio.ImageIO.read(Unknown Source)
    at Cube.<init>(Cube.java:178)
    at Starter.<init>(Starter.java:15)
    at Starter.main(Starter.java:8)

  2. #22
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    That means the file isn't there in the jar.
    Can you show us where it is?
    A simple ascii diagram will do:
    Java Code:
    MyJar -> src > TheCubeLogoEvilcubes2.png
    for example.

  3. #23
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Default

    Java Code:
      D drive -> Projects -> Game -> src TheCubeLogoevilcubes2.png
    Like that?

  4. #24
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    No.
    It needs to be in your jar file.
    The one you say you have a problem with running with the graphics.

  5. #25
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Default

    The exported jar version of the game is the one i'm having trouble with, and it isn't any folders or so in that jar, just a jar file to click and start the app. So i'm not quite sure how to place something into the jarfile

  6. #26
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Default

    Changing the word "graphics" to "jar" when using google, fixed my problem straight away. But Tolls, really thanks for trying to help me >.<
    Anyway, i fixed this doing:
    PHP Code:
    URL myurl = this.getClass().getResource("/TheCubeLogoevilcubes2.png");
    		Toolkit tk = this.getToolkit();
    		SSbg = tk.getImage(myurl);
    then adding "throws exception" to my two constructors, also i added it to the main method. Got no errors, grahpics are loading fine when running the program from outside my IDE, everything is goodie.

  7. #27
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    There you go.
    It was all about the location relative to the top of the jar.
    Well done getting the last few steps!

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 6
    Last Post: 12-09-2010, 09:44 AM
  2. Custom graphics on dialogs, etc.
    By trader5050 in forum New To Java
    Replies: 1
    Last Post: 11-24-2010, 08:29 AM
  3. Graphics program
    By ccie007 in forum New To Java
    Replies: 6
    Last Post: 10-27-2010, 09:08 PM
  4. custom graphics, buttons & drop boxes
    By jaytee in forum New To Java
    Replies: 1
    Last Post: 03-14-2010, 01:27 AM
  5. program help: Extracting words from a string
    By toad in forum New To Java
    Replies: 1
    Last Post: 11-04-2007, 07:39 PM

Posting Permissions

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