• Post Reply Bookmark Topic Watch Topic
  • New Topic

IDE Netbeans error on setIconImage(icon)  RSS feed

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

I'm still having a problem showing a jpeg on a form.

Is there any difference between Netbeans and standard Java? I'm just copying basic samples of Java code from the web and some of it just aint workin'

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.

P.S. Someone suggested using the Toolkit - What's the Toolkit?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what "cannot find symbol" means here...
but did you try :
PicFrame.setIconImage(icon.getImage());

(your variables should start with lowercase)
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!