自定义文件类型和图标
我有一个用 java 编写的游戏,它具有保存游戏并使用 .txt 文件加载它们的功能,但我认为如果我可以拥有自己的文件类型,那就太酷了...我知道我可以将其设置为另存为尚未定义的类型,但随后我得到该文件的空白图标...有没有办法可以在java中为其提供自定义文件图标?我在网上查过,但我发现的只是微软网站用 C# 和 VB 等解释了其中的一些内容......
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想如果你在Windows中创建了文件类型,只要你在Windows中,你就可以将文件类型添加到系统中。然后去查看现有的文件类型。现在将您的图标与该类型相关联。
以下是在 Windows 中执行此操作的方法:
http:// www.watchingthenet.com/associate-delete-file-types-in-windows-vista.html
在以前版本的 Windows 中,这可以在资源管理器中。谷歌一下很容易找到。
现在,一旦添加了类型,请执行以下操作:
http://www.webtlk.com/2009/03/20/how-to-change-the-icon-associated-with-a -file-in-windows-vista-and-windows-7/
这只会在您的计算机上执行此操作,如果您需要部署它,并希望以这种方式在另一台计算机上执行此操作,这应该足以让您使用像 InstallShield 这样的脚本来编写它。如果您告诉我您将要部署的安装程序,我什至可以提供一个脚本。
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.