×

Discussion Board

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

    May I know what is the problem here? How to solve it?

    synchronized public static Displayable getInstance(){
    if(instance == null){
    instance = new cvsUtil();
    }
    return instance;
    }

    public cvsUtil(Util midlet) {
    this.midlet = midlet;

    try {
    System.out.println("Create Image");
    image = Image.createImage ("/BG.png");
    }

    catch (IOException e) {
    throw new RuntimeException ("Unable to load Image: "+e);
    }

    Calculate();

    }

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    What error are you getting?
    You know, a little bit more information is very useful when asking for help.
    From the code you posted the only thing fishy is the the cvsUtil constructor expects a parameter of type Util, and in getInstance() you are trying to call a constructor without any parameters.

    shmoove

Posting Permissions

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