Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Netbeans IDE 5 - createImageIcon error

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try



You can also use the Toolkit.
 
Paul Carter
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
P.S. What's the Toolkit?
 
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic