GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Image in JFrame which opens from a JApplet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Image in JFrame which opens from a JApplet" Watch "Image in JFrame which opens from a JApplet" New topic
Author

Image in JFrame which opens from a JApplet

Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367
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


SCJP1.4
Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367
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
 
GeeCON Prague 2014
 
subject: Image in JFrame which opens from a JApplet