image on applet/stand-alone program

Discussion in 'Java' started by Guest, Sep 12, 2003.

  1. Guest

    Guest Guest

    I have create my program to run as Applet and Stand-Alone too.

    My problem is that, 'Image' created from 'Image getImage(URL url)'
    works perfect in Applet but don't work in Stand-Alone program
    Guest, Sep 12, 2003
    #1
    1. Advertising

  2. Guest

    Guest Guest

    > I have create my program to run as Applet and Stand-Alone too.
    >
    > My problem is that, 'Image' created from 'Image getImage(URL url)'
    > works perfect in Applet but don't work in Stand-Alone program


    I add the applet into a 'Frame' created in 'main()'

    The problem occurs as an Exception when I run code:
    --------
    Image ab = myApplet.getImage(new URL(myApplet.getCodeBase() + a));
    --------
    I have a 'NullPointerException' in 'getCodeBase()'

    What is the problem?
    What I can do?

    Thanks
    Guest, Sep 12, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Punya Narra
    Replies:
    5
    Views:
    1,678
    Itai Raz
    Feb 17, 2004
  2. freeposte
    Replies:
    7
    Views:
    4,679
    Roedy Green
    Feb 10, 2006
  3. Replies:
    7
    Views:
    427
    Andrew Thompson
    Feb 23, 2007
  4. ASPQuicky
    Replies:
    1
    Views:
    90
    Ken Cox [Microsoft MVP]
    Oct 13, 2004
  5. Plotinus
    Replies:
    2
    Views:
    286
    Tad McClellan
    Dec 17, 2004
Loading...

Share This Page