Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

imageIcon

 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now I've got another problem. I'm trying to make an imageIcon and add it to my content pane but it doesn't show up in my applet, theres a blank space where it should be. Is there something wrong with my code?

 
Brian Cole
Author
Ranch Hand
Posts: 906
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • Is there a reason you are using backslashes in the URL?
  • You intend to pass a URL to the ImageIcon constructor but you are actually passing in a String, which (according to the javadoc) will be interpreted as a file name. You may want to try new ImageIcon(new URL("http://blah...
  • Are you sure there is an image at that URL? If it can't find the image you you specify, it will silently behave as you describe. You may want to try an absolute pathname to an image on your local machine as a test.

  •  
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic