×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    2

    JBuilder - 7210 - CreateImage

    I try to load a picture which is in my project folder and in png format !

    My routine is :

    package firsttest;

    import java.io.*;
    import javax.microedition.lcdui.*;

    public class DisplayableTest extends Canvas {

    Image img = null;

    /**Construct the displayable*/
    public DisplayableTest() {
    try {
    img = Image.createImage("banner.png"
    //image = Image.createImage ("/logo.png"
    }
    catch (IOException e) {
    throw new RuntimeException ("Unable to load Image: "+e);
    }

    try {
    jbInit();
    }
    catch(Exception e) {
    e.printStackTrace();
    }

    --------
    Each time, I got a load error, can you help me ?

    Best regards,
    Eric

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    19

    RE: JBuilder - 7210 - CreateImage

    I don't know about JBuilder, but try "/banner.png" instead of "banner.png", and make sure this image is in the correct resource directory.

    ross

Posting Permissions

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