Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User onkel_jesper's Avatar
    Join Date
    Jul 2003
    Posts
    9
    HI
    public Pacman() {
    try {
    image[1] = Image.createImage("fish20.png");
    }
    catch (IOException ex) {
    System.out.println("no pic");
    }
    }
    I can't get any pic loaded, no mater where I put it? Like local Dir or on Image.createImage("C:/fish20.png");

    Can anyone help me???

  2. #2
    place the picture in the same directory as your class and call

    createImage with the name of the parent-folder where the class and the png are located in.

    Image var = Image.createImage("/parentfolder/picture.png");

    it works fine with me.

    Pay also attention to the Filename if it is .png or .PNG! Java makes a diffrence here!

  3. #3
    Registered User onkel_jesper's Avatar
    Join Date
    Jul 2003
    Posts
    9
    Thanks!
    The problem whas that JBuilder was setup to only look tre step down in package.... (

    Now i'am up and running. Have a nice weekend

    bye bye
    -Jesper

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved