• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

need help with getImage()

with the getImage() method, it needs a URL and a string name for the agruements.  what do i put for the URL if it is a local file, but not in the same directory as the applet itself.  therefore i can't use the "getDocumentBase()" or "getCodeBase()".  so what's the answer?
0
typhoid
Asked:
typhoid
  • 3
  • 2
1 Solution
 
aziz061097Commented:

Do something like this

Image img = getToolkit().getImage("test\\About.jpg");
g.drawImage(img, 0, 0, 615, 430, this);

0
 
typhoidAuthor Commented:
this might work, i kept getting a nullpointer exception which doesn't make sense to me, because there was nothing mispelled, and all the files were where i specified them to be.  i'm not sure what the "test" in your answer is, is that the path?
0
 
aziz061097Commented:
Yes that is quite obvious . You have to escape the path ... I did not know you could not figure it out or I would give more explanation.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
aziz061097Commented:
I put the image file About.jpg in a sub directory "test".
0
 
typhoidAuthor Commented:
i could figure it out, i just wasn't positive, and i like to be positive.  anyway, thanx for the advice, it might help
0
 
tparvaizCommented:
Mr aziz have my reguards, i appreciate your help
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now