Solved

need help with getImage()

Posted on 1998-07-30
6
233 Views
Last Modified: 2011-09-20
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
Comment
Question by:typhoid
  • 3
  • 2
6 Comments
 
LVL 2

Accepted Solution

by:
aziz061097 earned 50 total points
ID: 1229291

Do something like this

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

0
 

Author Comment

by:typhoid
ID: 1229292
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
 
LVL 2

Expert Comment

by:aziz061097
ID: 1229293
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
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 
LVL 2

Expert Comment

by:aziz061097
ID: 1229294
I put the image file About.jpg in a sub directory "test".
0
 

Author Comment

by:typhoid
ID: 1229295
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
 

Expert Comment

by:tparvaiz
ID: 1229296
Mr aziz have my reguards, i appreciate your help
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
micro services vs rest web services 16 106
eclipse argument 14 61
How  Can  I  resolve   this  Error "java.sql.SQLException: Invalid column index" 4 38
null output 3 25
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question