permaculture playing cards*
The moose likes Swing / AWT / SWT and the fly likes Problem in getting output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem in getting output" Watch "Problem in getting output" New topic
Author

Problem in getting output

Dhivya rajagopal
Ranch Hand

Joined: Dec 15, 2010
Posts: 42
Hi, The following program helps us to set the icon (image) on the title bar of the frame. but after executing it is not displaying the image in the title bar
If i simply set the name of the image alone, example- sunset.jpg, it doesn't show any error. but while running image is not displayed. if i give the whole path of the image, it displays compile time error ("illegal escape character).
can you please tell how to resolve
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

How are you specifying the path?


Swastik
Dhivya rajagopal
Ranch Hand

Joined: Dec 15, 2010
Posts: 42
Thank you Dey

Before submitting this doubt in the forum, i gave as following
C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\sunset.jpg

But after that i found and gave
C:Documents and Settings:All Users:Documents:My Pictures:Sample Pictures:sunset.jpg
After giving the above, it doesn't show compile time error. But still the image didn't display in the title bar.

If i place the image in the d: drive and give as
D:sunset.jpg
It displays the correct output

But if i place the image in the c: and give as
C:sunset.jpg
It doesn't show the image in the title bar


can you please tell me how to resolve
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

Dhivya,

The problem is escape characters, so you need to specify the path like this

Dhivya rajagopal
Ranch Hand

Joined: Dec 15, 2010
Posts: 42

Thank you Dey
 
Don't get me started about those stupid light bulbs.
 
subject: Problem in getting output