Thank you for finding that code for me.
I tried going into Explorer and changing the name of the Desktop, but I get
a message "Cannot rename file. File system error (1026)"
> I tried going into Explorer and changing the name of the Desktop,
> but I get a message "Cannot rename file. File system error (1026)"
I just renamed it on my system without any problems. I just found the
actual folder and renamed it using Windows Explorer. As I recall, the
folder is normally under "Documents and Settings/<username>", although
I have it in a different location on my system. The error you got may be
because you are using a different operating system - I am using Window
XP Pro.
I ran the SwingSet JFileChooser example, and the tooltip for the Desktop
button showed the new name. So my guess is that you really do not have to
worry about this. The folder name probably varies by locale and the name
should make sense for that locale.
If you really need to change the tooltip, you should be able to accomplish
that. The tooltip is set by the UI when it is installed, so you could add
a property listener to the JFileChooser for the "UI" property and change
it then by hunting down the button in the component hierarchy and setting
it using setTooltipText().
Obviously, this kind of approach is dependent on the UI and can be
somewhat fragile, but if you use a conservative approach, you should be
able to make it work in almost all cases and "do no harm" in others.

Signature
Regards,
John McGrath
Jim Cobban - 12 Jan 2005 16:59 GMT
Thank you for going out of your way to help me. I am still running Win98
which may explain a lot of my problems. For example, although nobody else
can reproduce this behavior, I cannot get JFileChooser to show the correct
file icons for Windows. I have had to override FileSystemView to supply my
own icons for the file types that my application supports. I attempted to
change the name of the desktop folder not in its real location in the
hierarchy but rather in the spot where it appears when you first enter
Explorer. Your test reassures me that the button will have an appropriate
name on any system that it is run on. I assume that the Windows
installation process names various folders, including Desktop, in a manner
appropriate to the locale specified when the system was installed.
> > I tried going into Explorer and changing the name of the Desktop,
> > but I get a message "Cannot rename file. File system error (1026)"
[quoted text clipped - 20 lines]
> somewhat fragile, but if you use a conservative approach, you should be
> able to make it work in almost all cases and "do no harm" in others.