How can I change the type of URL object to a string?
eg.
private java.net.URL texImage;
String str;
str = texImage.toString();
why it is not work ?
thx!
why it is not work ?
thx!
Bc. you get a NullPointerException for there is no URL object present?
Please tell us what you expect to happen, what actually happens, and any exceptions that get thrown.
yes, you are right!
SDK show that “NullPointerException”
I want open a image in a applet through the
java.net.URL.
Must ues “java.net.URL” ?Can i use other method?
I want use a String to store the URL.
thx!
You can’t call methods on a null object reference… you actually need to have a URL first… you haven’t shown any object being assigned to your URL reference.
What does this have to do with Java 3D?
Thanks to everyone!
I solve my problem la!
it is not the URL object problem,it can point to
a url.
I make a mistake in string.
I use URL.toString().substring(index) to solve.
Moved the topic to the newbie forum, hope thats ok.