Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to load a jpeg in java Swing?

 
Bob Zoloman
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been trying to load an image ( any image ) using swing, but I can't get it to work. I don't even know which method or class to use. Each search result turns up something different... Any help is appreciated.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What possible classes have you found?
 
Bob Zoloman
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I finally got it to work. I'm using ImageIcon and placing the images in either a button, label, or panel.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!