Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in getting output

 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1604
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you specifying the path?
 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1604
5
Android Java Java ME
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dhivya,

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

 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thank you Dey
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic