Thread: multiple images
View Single Post
Old Jun 12th, 2005, 11:12 AM   #1
Dark Flare Knight
Hobbyist Programmer
 
Join Date: Mar 2005
Location: Canada
Posts: 113
Rep Power: 4 Dark Flare Knight is on a distinguished road
multiple images

how can i display multiple images in a java application?

right now, this is what i'm doing:

import java.awt.*;
import hsa.Console;
import java.awt.image.*;
public class img1 implements ImageObserver
{
    static Console c = new Console ();
    public Image Pic;
    public static void main (String[] args)
    {
        new img1 ();
    }


    public img1 ()
    {
        Toolkit tk = Toolkit.getDefaultToolkit ();
        Pic = tk.getImage ("1.jpg");
        tk.prepareImage (Pic, -1, -1, this);
    }


    public boolean imageUpdate (Image img, int infoflags, int x, int y, int width, int height)
    {
        if (infoflags == 32)
        {
            c.drawImage (Pic, 16, 16, null);
        }
        return true;
    }
}

Last edited by Dark Flare Knight; Jun 12th, 2005 at 2:27 PM.
Dark Flare Knight is offline   Reply With Quote