Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Netbeans IDE 5 - createImageIcon error

 
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.
 
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!