Image loading and showing problem

Discussion in 'Java' started by sacha.vdk@gmail.com, Jul 13, 2006.

  1. Guest

    Hi,

    I'm trying to make a little java application for my website, but I have
    to load images. The compiling of the code gives no errors, but when I
    run it, it says "Applet not initialized". I know wich row the message
    causes, but I don't know how to solve it.
    Here's the code:

    -------------------------------------------------------------------------------------------------------------
    import java.awt.*;
    import java.applet.*;
    import java.awt.Image.*;

    public class App extends Applet {
    DeskTop desktop;

    public void init() {
    desktop = new DeskTop( );
    }

    public void paint(Graphics g) {
    desktop.paint( g );
    }
    }

    class DeskTop extends App {
    private String desktopimagename;
    private Image desktopimage;

    public DeskTop( ) {
    desktopimagename = "bg_Tiger.jpg";
    desktopimage = super.getImage(super.getDocumentBase(), "img/" +
    desktopimagename);
    }

    public void paint( Graphics g ) {
    g.drawImage( desktopimage, 0, 0, super.WIDTH, super.HEIGHT, this );
    }
    }
    -------------------------------------------------------------------------------------------------------------

    The code wich causes the message is the 23rd row:

    desktopimage = super.getImage(super.getDocumentBase(), "img/" +
    desktopimagename);

    Does anybody know something that can solve this?

    Thanks in advance...
     
    , Jul 13, 2006
    #1
    1. Advertising

  2. wrote:
    > Hi,
    >
    > I'm trying to make a little java application for my website, but I have
    > to load images. The compiling of the code gives no errors, but when I
    > run it, it says "Applet not initialized". I know wich row the message
    > causes, but I don't know how to solve it.
    > Here's the code:


    Your code makes no sense, in at least half a dozen ways. You really need
    to get a good Java textbook, because whatever you're using now is only
    confusing you.

    --
    John W. Kennedy
    "The blind rulers of Logres
    Nourished the land on a fallacy of rational virtue."
    -- Charles Williams. "Taliessin through Logres: Prelude"
     
    John W. Kennedy, Jul 13, 2006
    #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. Earl Teigrob
    Replies:
    2
    Views:
    374
    Earl Teigrob
    Feb 20, 2004
  2. Ray Booysen
    Replies:
    2
    Views:
    656
    Ray Booysen
    Mar 28, 2006
  3. Sandeep Singh Sekhon

    Problem: Image Control again showing the same Image

    Sandeep Singh Sekhon, Aug 2, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    489
    Walter Wang [MSFT]
    Aug 7, 2006
  4. Replies:
    4
    Views:
    325
  5. edfialk
    Replies:
    0
    Views:
    194
    edfialk
    May 10, 2007
Loading...

Share This Page