Original Post
Greetings all, I am new to java coming from a C/C++ background.
I was wondering if it was possible to load an image, instead of using an URL I put the pathname to the image? Due to the fact that my pc has no isp and I was thinking if I put the path it should still work. No compile errors but when the program is executed I get some errors like "cannot find resource". Sorry I didnot post the whole error, using 2 pcs here! I am using JCreator Pro 2.5 and XP. Any help is appreciated, thanks in advance!
=========================================
import java.awt.Graphics;
import java.awt.Image;
public void Player extends public java.applet.Applet
{
Image myImage;
void init()
{
myImage =getImage(getcodeBase(),"C:/MyProgramms/player.gif");
}
void public paint(Graphics g)
{
g.drawImage(myImage, 0, 0, this);
}
========================
//code in applet
==================
//applet code="player.class" codebase="C:/MyProgramms/player.gif" height=200 weight=100>
-----------------------------
"There are ones that say they can and there are those who actually do."
"...u can not learn programming in a class, you have to learn it on your own."
[edited by - cMADsc on January 9, 2003 3:50:33 PM]