Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image in JFrame which opens from a JApplet

 
Mathias Nilsson
Ranch Hand
Posts: 367
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic