title: Image in Java applet won't show up
body: <p>I have a project due Sunday (in school) and I am having problems showing images.</p>
  
  <p>Everything else but the image is working, I used code examples from many people but none of them worked.</p>
  
  <p>I put the image saved as "car.png" in the project directory.</p>
  
  <p>Can you tell me where I'm wrong?</p>
  
  <p>It's a project where I need to make a Java Applet that shows a street with a few buildings, a road and a car on the road, but I can't get the car image to show.</p>
  
  <p>Thank you very much for your help!</p>
  
  <pre><code>import java.applet.*;
  import java.awt.color.*;
  import java.awt.Graphics;
  import java.awt.*;
  
  
  
  public class App_Main extends Applet
      {
      House[] h;
      private Image img;
  
      public void init()
      {
          Private v1 = new Private(120,300,80);
          Private v2 = new Private(180,300,80);
          Building b1 = new Building(300,300,80,5);
          img = getImage(getCodeBase(),"car.png");
  
  
          h= new House[3];
  
          h[0] = v1;
          h[1] = v2;
          h[2] = b1;
      }
      public void paint (Graphics g) {
          Private v1 = new Private(120, 300, 50);
          Private v2 = new Private(180, 300, 50);
          Building b1 = new Building(300, 300, 80, 5);
  
  
          House[] h = new House[3];
  
          h[0] = v1;
          h[1] = v2;
          h[2] = b1;
  
          for (int i = 0; i &lt; 3; i++) {
              g.setColor(Color.BLUE);
              h[i].paintHouse(g);
          }
  
          //start road
  
          g.setColor(Color.BLACK);
  
          g.drawLine(0, 370, 1000, 370);
          g.setColor(Color.GRAY);
          g.fillRect(0, 371, 1000, 150);
          g.setColor(Color.BLACK);
          g.drawLine(0, 520, 1000, 520);
          for (int x=0; x &lt; 1000; x += 100)
          {
              g.setColor(Color.WHITE);
              g.fillRect(x+25, 430, 50, 20);
          }
  
          //end road
  
          g.drawImage(img,50,50,this);
  
  
  
      }
  }
  </code></pre>