Custom file type and icon

谁都会走 提交于 2019-12-21 09:27:33

问题


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...


回答1:


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.



来源:https://stackoverflow.com/questions/2428958/custom-file-type-and-icon

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!