Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What am I doing wrong here?

 
Christopher Dee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry if you get a lot of these questions here, but I really am straining to see what I'm doing wrong.
My problem is with the getImage method. I've used it in a number of applets so far, and I haven't had any difficulty with it. But for some reason, this one particular applet returns a " cannot resolve symbol - symbol : method getCodeBase ()" error when I try to compile. Not that that's very helpful.
I've re read through the section of my web tutorial that covers images, and I'll still can't figure out how I'm using it wrongly.
Here is the code. Can anyone spot the error?
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ October 15, 2002: Message edited by: Dirk Schreckmann ]
 
Blake Minghelli
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getCodeBase() is not a method defined in your class nor the Canvas class that it extends. So, that's why the compiler is basically telling you that it doesn't understand getCodeBase().
getCodeBase() is a method of Applet, maybe that's why you are confused?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you'd like to add an image to your canvas, you may find the java.awt.Toolkit class to be useful.
And for a more direct hint...
Image myImage = Toolkit.getDefaultToolkit().getImage( String or URL );
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic