Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem using "URL", Cannot Resolve Symbol

 
Matt Wil
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I saw the code below post to load images from a Jar in an Applet. I keep getting the error "Cannot Resolve Symbol" or "Cannot be resolved or is not a type(from Eclipse)" because of the "URL" statement.
Do I need to import a certain class?
Thanks!
URL url = <classname>.class.getResource("picture.gif");
Image i=Toolkit.getDefaultToolkit().getImage(url);
 
Matt Wil
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll answer my own dumb question:
import java.net.URL;
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!