Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom file type and icon

Tags:

java

file

icons

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

like image 723
Becky Avatar asked Mar 11 '10 21:03

Becky


People also ask

How do I assign a custom icon to a file type?

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.

What file type is an icon?

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.

What is icon and file?

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.


1 Answers

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.

like image 142
James Campbell Avatar answered Sep 26 '22 02:09

James Campbell