This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JNLP and Web Start and the fly likes Displaying an Image on a thick-client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Displaying an Image on a thick-client" Watch "Displaying an Image on a thick-client" New topic

Displaying an Image on a thick-client

Richa Anand

Joined: Aug 27, 2005
Posts: 6
Hello All,
I have a very simple app. I just wanna display an JPEG on a frame. I have configured Apache Tomcat and created JNLP file. Everything is working just fine except that the image is not being displayed.

Code Snippet
class MyFrame extends JFrame{
MyFrame(String title){
MyDrawPanel drawPanel=new MyDrawPanel();

addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent we){
public void paint(Graphics g){
g.drawString("App Home",20,50);

Image img=Toolkit.getDefaultToolkit().getImage("logo.jpg");


public class AppHome{
public static void main(String args[]){
MyFrame fr=new MyFrame("title");
I'm creating the JAR file like this:
jar -cvf Home.jar logo.jpg *.class

Anybody pls help, how do I go abt that?

Ben Harrison

Joined: Jan 26, 2006
Posts: 27
are you sure it's not something with your path to the logo.jpg? I'm guessing that it's trying to find it at the root, but it's not technically the root path. Or maybe it's a permission issue?
I agree. Here's the link:
subject: Displaying an Image on a thick-client