Icon for a File

hi all.

i have created a text file with extension of .txt or .dpt... through outputStream like

OutputStream out =new FileOutputStream("Sample1.txt");

OutputStream out =new FileOutputStream("Sample2.dpt");

i need to set an icon for this Sample1.txt and Sample2.dpt.. so that when i view that file in windows explorer, the icon shoud be viewed.. like how we see windows notepad icon for .txt file..

how i can set icon for a file through java code...

i would be very thankfull if i got solution for this....

Regards

Suresh

[692 byte] By [Suresh22a] at [2007-11-27 3:55:16]
# 1

The icon is not contained within the files, it is part of the operating system's config'.

For this reason, Java will inherantly not have capability to control the icon settings.

In windows a Java programme can execute native code to change the "folder settings->File Extension" settings. Needless to say this would remove the programme's portability. The only other thing i can offer (which isn't java related and again applies only to windows) is to mess around with .inf files contained in the same folder - this can change the icon of the containing folder so maybe it can change the icon of the files too..... This is the wrong forum to discuss.

Sorry I couldn't be of more help

Bamkin

bamkin-ov-lestaa at 2007-7-12 8:59:25 > top of Java-index,Desktop,Core GUI APIs...