Java: DrawImage from array
<p>I am new to java and i am having alot of problems trying to display images into my program.
I have placed the images in the proper map and have placed them into a array:</p>

<pre><code>    private Image[] images;
    images = new Image[9];
    images[0] = new ImageIcon("images/hang1.png").getImage();
    images[1] = new ImageIcon("images/hang2.png").getImage();
    images[2] = new ImageIcon("images/hang3.png").getImage();
</code></pre>

<p>The next part i cannot manage to get the image displayed at all. I have tried multiple options without success.</p>

<pre><code>    public void paintComponent(Graphics g)
{
    super.paintComponent(g);
    int count = 0;

        g.drawImage(images[count], 50, 50, ImageObserver );
        count++;
}
</code></pre>

<p>Any solution to this would be very welcome!
Kind Regards.</p>
