....
>Am new to java.
Those who are new to Java, are best off avoiding GUI'd
applications, and *especially* applets.
A good groups for people learning Java is comp.lang.java.help
>...it didnt show the img in applet.
...
>public class image extends applet
>{
Please indent code using the usual conventions,
though it is best to replace 'tab' characters with
spaces before posting.
>public void init()
>{
>Image img;
>img=getImage(getCodeBase(),"rabbit.gif");
<http://java.sun.com/javase/6/docs//api/java/applet/Applet.html#getImage(java.net.URL
)>
"This method always returns immediately,
whether or not the image exists."
It might be..
1) the Image cannot be found, or ..
2) the Image has not loaded yet.
A simple debugging technique for the first,
is to print the URL that is formed by adding
the codebase to the name, and then trying a
'direct fetch' on that URL in a browser.
For the second one, a MediaTraker can be used..
<http://java.sun.com/javase/6/docs//api/java/awt/MediaTracker.html>
HTH

Signature
Andrew Thompson
http://www.athompson.info/andrew/
RANG - 23 Apr 2007 09:30 GMT
> ...
>
[quoted text clipped - 41 lines]
>
> Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-general/200704/1
Thanks for alot of technique andrews
Andrew Thompson - 23 Apr 2007 10:14 GMT
...
>Thanks for alot of technique andrews
You're welcome, but we* are generally more interested in
hearing the results (e.g. "URL was correct, but MediaTracker
solved the problem"), and note that my name is Andrew,
rather than Andrews.
* This helps not just me, but anyone else on the
group to know if more help is required - it also helps
anybody that finds the thread later, to know what
worked, and what did not work.
Good luck with it, and please get back to us
with the progress.

Signature
Andrew Thompson
http://www.athompson.info/andrew/