Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Netbeans IDE 5 - createImageIcon error  RSS feed

 
Paul Carter
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I'm currently trying to learn Java using Netbeans IDE 5, and I'm stuck trying to use the createImageIcon command e.g.

ImageIcon leftButtonIcon = createImageIcon("images/right.gif");

Whatever I do I seem to keep getting the error:
"Cannot Find Symbol
Symbol: Method createImageIcon(java.lang.string)"

Any ideas what I'm doing wrong?

Thanks in advance.

Paul.
 
Petrus Pelser
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try



You can also use the Toolkit.
 
Paul Carter
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers Petrus

Seems to like that command better, but have yet to show the image

ImageIcon icon = new ImageIcon("c:/image.jpg"); //Seems OK
JFrame PicFrame = new JFrame("PictureFrame"); //Seems OK

PicFrame.setIconImage(icon); //Cannot Find Symbol

I want to have an area of the screen where I can keep changing an image depending on various events.

All help appreciated.

Regards and thanks

Paul.
 
Paul Carter
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. What's the Toolkit?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!