This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Image in JFrame which opens from a JApplet
 
Similar Threads
JMenuBar
JApplet and JPanel Stretching
JApplet + JPanel + image.jpg
class.getResource() in applet
urgency!!! In Japplet, how to make......