February 24th, 2009, 04:41 PM
Problem: Set your own icons as icon image on file icon
Do u know how to use your own (self made) icon as a file icon when u save with:
Employee e1 = new Employee("A", 45000.0);
FileOutputStream fos = new FileOutputStream("employee.ser");
ObjectOutputStream oos = new ObjectOutputStream(fos);
Well I'm developing a program where u can draw stuff on a drawingboard, so when I want to save that project (drawingboard with drawn stuff on it) I want to use my own icon but I don't know how to do it, and I have googled a lot.
When I save the project the icon of the saved project is the Unknown Icon...
Do u have any ideas?
Or can I add my icon to shell32 and the retrieve my icon from there or something similar?
February 24th, 2009, 05:05 PM
Re: Problem: Set your own icons as icon image on file icon
Which icon is displayed for a file is up to the OS you are using, not the program that creates the file. AIUI the OS associates the file extension with an icon. To set your own icon, you'll have to get the OS to associate your icon with your file extension.
Java can't really help with this, it is designed to be platform agnostic, so it has few OS specific facilities. I'd be inclined to use a native language (e.g. C/C++ or C# with Windows) or a OS-supported scripting language.
The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities...
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Tags for this Thread
Click Here to Expand Forum to Full Width