File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image in JFrame which opens from a JApplet

 
Mathias Nilsson
Ranch Hand
Posts: 367
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I have a JApplet that opens a JFrame to do certain preocedures. How do i get an Image in tje JFrame?

I use getCodeBase() in my JApplet but this method does not exitst in the JFrame and I do not wish to send the Image as parameters to the JFrame.

Thanks
// Mathias
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok! I think i resolved it.

new ImageIcon(getClass().getResource("/images/folder.gif"));

Is this the fastes way or does anyone have a better id�?

// Mathias
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic