![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2005
Location: Canada
Posts: 113
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Jun 2005
Posts: 11
Rep Power: 0
![]() |
Ok, I got 3 compiler errors when I compiled your code.
C:\Documents and Settings\student\Desktop\img1.java:2: package hsa does not exist
import hsa.Console;
^
C:\Documents and Settings\student\Desktop\img1.java:6: cannot resolve symbol
symbol : class Console
location: class img1
static Console c = new Console ();
^
C:\Documents and Settings\student\Desktop\img1.java:6: cannot resolve symbol
symbol : class Console
location: class img1
static Console c = new Console ();I've never heard of hsa.Console. What's hsa? |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Mar 2005
Location: Canada
Posts: 113
Rep Power: 4
![]() |
hsa.Console.....we use this in school and i got it from the software my teacher gave me.
It's used to create a Console identifier and instead of System.out., we use the identifier. |
|
|
|
|
|
#4 |
|
Programming Guru
![]() |
unfortunatly it does provide a problem with debugging your code if we dont have the hsa console thingy :/
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: Mar 2005
Location: Canada
Posts: 113
Rep Power: 4
![]() |
should i post it here? i mean the file.
EDIT The only thing that's using the hsa.Console is the c.drawString and the static Console c = new Console (); and except these two, the rest are from java.awt.*; and java.awt.image.*; i think. Last edited by Dark Flare Knight; Jun 13th, 2005 at 8:15 PM. |
|
|
|
|
|
#6 |
|
Newbie
Join Date: Jun 2005
Posts: 11
Rep Power: 0
![]() |
The thing is, even though only a couple of statements may be using hsa.Console, I can't compile your code without it. If I can't compile your code, I can't run your program. I don't know what to tell you if I don't know what it already does.
So I'd like to see hsa.Console so I can try to help you better. ![]() |
|
|
|
|
|
#7 |
|
Hobbyist Programmer
Join Date: Mar 2005
Location: Canada
Posts: 113
Rep Power: 4
![]() |
But do you know how to display multiple images in a java application?
|
|
|
|
|
|
#8 |
|
Professional Programmer
|
Dude, have u ever heard of GOOGLE ? this is the first link that apears :
http://forum.java.sun.com/thread.jsp...sageID=3590564
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
#9 | |
|
Hobbyist Programmer
Join Date: Mar 2005
Location: Canada
Posts: 113
Rep Power: 4
![]() |
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|