I have a game I'm writing in java, it has the functionality to save games and load them all working with .txt files but I thought it would be cool if I could have my own file type...I know I can just set it to save as a type that isn't already defined but then I get a blank icon for the file...is there a way I can give it a custom file icon in java? I've looked online etc but all I find is the microsoft website explaining some of it in c# and vb etc...
Right click extension whose icon you want to change and then select “Edit Selected File Type.” In the “Edit File Type” window, click the “…” button to the right of the Default Icon text field. The “Change Icon” window shows some basic icons, but click the “Browse” button to find your own icon files.
The ICO file format is an image file format for computer icons in Microsoft Windows. ICO files contain one or more small images at multiple sizes and color depths, such that they may be scaled appropriately.
An ICON file contains image data for a computer icon used to represent files, folders, applications, and so on. ICON files are typically saved as small, square bitmap images, ranging from 16 x 16 to 256 x 256 pixels in size. Most Windows Icon files use the . ICO extension.
I would think if you created the filetype in windows, provided you are in Windows, you can add the file type to the system. then go view existing file types. Now associate your icon to that type.
Here is how to do it in Windows:
http://www.watchingthenet.com/associate-delete-file-types-in-windows-vista.html
in previous versions of windows this can be in Explorer. Google around easy find.
Now once you have added the type, do this:
http://www.webtlk.com/2009/03/20/how-to-change-the-icon-assiciated-with-a-file-in-windows-vista-and-windows-7/
This will only do this on your machine, if you need to deploy this, and want this on another machine this way, this should give you enough to work with to script it out with like InstallShield. If you tell me the installer you will be deploying, I can even provide a script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With