Cannot set custom icon
I'm trying to set a custom icon on a FAT32 formatted external HDD. What I did is take a PNG and drop it into Icon Composer, then saved the result as .icns with Icon Composer.
I highlight the resulting .icns file and press CMD+C. I open the Get Info window for my external drive, click the icon in the top right of the window (not the one in the title bar) and press CMD+V. Instead of the icon, I get a generic icns file picture as if it was a Preview document, not the icon itself.
Can't imagine why this isn't working. Worked before with other icons. Help?
Same result oddly enough. The result is the aforementioned "Preview document" icon.
Here was the solution! It required the terminal (or hidden files shown). There's the presence of a .VolumeIcon.icns for the drive icon right? Well I just typed +cp /Users/username/Desktop/i.icns .VolumeIcon.icns+ into the Terminal while the current directory was the drive. It overwrote the bad one with the good one. No idea why it couldn't be done via the Get Info window, but it works now.
Similar Messages
-
CheckBox - how to set custom icons
I need to figure out how to set a custom icon for a selected checkbox via the UIManager
This works for un-selected checkboxes:
UIManager.put("CheckBox.icon", new ImageIcon("../images/unselectedCheckBoxIcon.png")));
how to change the icon when it is selected?
I don't know the UIManager property for a selected checkbox icon and using the setSelectedIcon on the checkbox object it self does not seem to work:
checkbox.setSelectedIcon(new ImageIcon("../images/selectedCheckBoxIcon.png"));
Thanks for any ideas how to solve this!!Hi mKorbel, many thanks for your suggestion!
For anyone interestsed,
here is a small example of how I made it working.
Unfortunately I cannot attatch the icon images that I use, but the selected icon can be downloaded from here, resize it to 32*32, remove the cross in the middle to save it as the unselected icon.
* Modified sample code taken from here
* http://www.java2s.com/Tutorial/Java/0240__Swing/CustomizingJCheckBoxCheckMarkIcon.htm
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.net.URL;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
public class IconCheckBoxSample {
public static void main(String[] args) {
JFrame frame = new JFrame("Iconizing CheckBox");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Icon checked = new CheckBoxIcon();
Icon unchecked = new CheckBoxIcon();
JCheckBox aCheckBox1 = new JCheckBox("Pizza", unchecked);
aCheckBox1.setSelectedIcon(checked);
JCheckBox aCheckBox2 = new JCheckBox("Calzone");
aCheckBox2.setIcon(unchecked);
aCheckBox2.setSelectedIcon(checked);
Icon checkBoxIcon = new CheckBoxIcon();
JCheckBox aCheckBox3 = new JCheckBox("Anchovies", checkBoxIcon);
JCheckBox aCheckBox4 = new JCheckBox("Stuffed Crust", checked);
frame.setLayout(new GridLayout(0,1));
frame.add(aCheckBox1);
frame.add(aCheckBox2);
frame.add(aCheckBox3);
frame.add(aCheckBox4);
frame.setSize(300, 200);
frame.setVisible(true);
class CheckBoxIcon implements Icon {
public void paintIcon(Component component, Graphics g, int x, int y) {
AbstractButton abstractButton = (AbstractButton)component;
ButtonModel buttonModel = abstractButton.getModel();
if(buttonModel.isSelected())
g.drawImage(createImage("../images/selectedCheckBoxIcon.png","info"), x, y, component);
else
g.drawImage(createImage("../images/unselectedCheckBoxIcon.png","info"), x, y, component);
public int getIconWidth() {
return 33;
public int getIconHeight() {
return 33;
protected static Image createImage(String path, String description) {
URL imageURL = CheckBoxIcon.class.getResource(path);
Image icn = null;
if (imageURL == null) {
if(null==icn){
//System.out.println("path: "+path);
icn = new ImageIcon (CheckBoxIcon.class.getResource(path.replace("..",""))).getImage();
if(null!=icn)
return icn;
else{
System.err.println("Resource not found: " + path);
return null;
return null;
} else {
return (new ImageIcon(imageURL, description)).getImage(); -
Unable to set custom icon for system drive
Title says it all. Can't paste new custom icon onto drive icon in the Info panel-nothing happens. Any ideas?
When a custom icon is applied to a folder (including the "boot drive" icon, which is really just the top level folder), an invisible "Icon\r" file is created inside that folder (or a ".VolumeIcon.icns" in case of a volume - I missed this in the last post, sorry) and the "Custom Icon" file attribute is set. In order to do these things, a user must have sufficient privileges to modify the folder.
In Leopard, the default permissions are:<pre>
$ lsbom -d /Library/Receipts/boms/com.apple.pkg.Essentials.bom |grep "^. "
. 41775 0/80</pre>
The owner is "root", group is "admin", both have "read & write" privileges, and everyone else has "read only" privileges.
Similarly, in "Tiger":<pre>
$ lsbom -d /Library/Tiger/BaseSystem.pkg/Contents/Archive.bom |grep "^. "
. 41775 0/80</pre>
Nothing has changed. But furthermore, since the "sticky" bit is set, this might even mean that a custom icon set by one "admin" would only be removable by the same "admin" (though this isn't something I have tested). But either way, at a minimum, "admin" privileges would normally be required.
So if you had previously modified the permissions on the boot drive to allow non-admins to make changes, then certainly you woudn't have to have "admin" privileges to do this. But that is not the "normal" state.
Beyond that, it's hard to say why you can't make the changes even as an "admin" without at least knowing what the current permissions are on "/" and "/.VolumeIcon.icns"... -
I downloaded custom icons.
I select Get info on the custom icon. I select it. Select edit copy.
I select the main icon. I select Get Info. I select it. I CANNOT SELECT PASTE BECAUSE IT IS GRAYED OUT.permissions system in snow leopard has changed and admin users no longer have write permissions to safari (and other preinstalled apps). if you look at the permissions section of the get info popup for safari you'll see that admin group is not listed and instead the group listed is wheel. you can temporarily change the group to admin to apply the icon. but this has to be done from terminal. want to see the details?
-
Cannot set custom print settings using mg6220
Have just purchased a new iMac running 10.8.2 and Canon MG 6220. Can print, but am not able to set custom print settings and see disclosure triangle in the Print Dialogue Window that I would click on to get to this option. The instructions and illustrations in the manual are not the same as what I am seeing in my print window.
Then I think you have selected the AirPrint driver rather than the MG6200 Series driver.
So what you can do is open Print & Scan, select the current MG6220 in the Printers list and press the minus button to remove it. Then click on the plus button next to the minus button to add but if a little sub-menu window appears showing the MG6220 under the heading of Nearby Printers, as shown below with my MP990, do not select this.
Instead, select the menu item that says Add Printer or Scanner. This will make the Default Add printer view appear. Here you should see the MG6220. Select it and if the Use menu shows AirPrint, click on this menu and select Canon MG6200 Series. Then click Add to complete. This should now give you the same Quality & Media menu that I have shown above. -
Automatically create folders then attach custom icon to each folder.
This is my current working script, does anyone know how I can now add customer icons to the folders in Applescript
Many thanks
Matt
set theWeekNumber to ""
repeat
display dialog "Please enter the week number:" default answer theWeekNumber
set theWeekNumber to text returned of result
try
if theWeekNumber = "" then error
set theWeekNumber to theWeekNumber as number
exit repeat
on error
set thePrefix to "INVALID ENTRY! "
end try
end repeat
set theAFolder to "AFolder_WK" & theWeekNumber
set theBFolder to "BFolder_WK" & theWeekNumber
set theEnd to "_PSD"
set theEnd2 to "todo"
tell application "Finder"
make folder at folder "Studio:Users:matthewchild:Desktop" with properties {name:theAFolder & theEnd}
make folder at folder "Studio:Users:matthewchild:Desktop" with properties {name:theBFolder & theEnd}
make folder at folder "Studio:Users:matthewchild:Desktop" with properties {name:theAFolder & theEnd2}
make folder at folder "Studio:Users:matthewchild:Desktop" with properties {name:theBFolder & theEnd2}
end tellThe following script uses a handler that will set a custom icon to a file item. In this example, you are prompted for the icon file and the file item to set to the icon, but you can just pass the desired image and folder paths directly to the handler.
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #FFD891;
overflow: auto;"
title="this text can be pasted into the AppleScript Editor">
-- assign an icon to a folder or file (requires Developer Tools)
-- any image file can be used for the icon
property startingDirectory : (path to home folder) -- a place for the file choice dialogs to start from
on run -- example
try -- check for tools
get "/Developer/Tools/" as POSIX file as alias
on error
error "Developer Tools not installed"
end try
set iconFile to (choose file with prompt "Choose an image file for the icon:" default location startingDirectory)
if (do shell script "/usr/bin/file " & quoted form of POSIX path of iconFile) does not contain "image" then -- check image file
error "The icon file is not an image"
end if
tell application "Automator Runner" to tell open panel -- using this panel allows the choice of a file or folder
set floating to true
set can choose directories to true
set can choose files to true
set allows multiple selection to false
call method "setShowsHiddenFiles:" of it with parameters {false}
set title to "Select an item to set to the custom icon:"
set prompt to "Set Icon" -- this is actually the button text
activate
if (display it in directory startingDirectory) is 0 then -- cancel button
error number -128
else
my (setCustomIcon from iconFile to (it's path names as text)) -- just one item
end if
end tell
end run
to setCustomIcon from imageFile to destination
Set the icon of a destination file item to the image contained in imageFile
parameters - imageFile [various]: an imagefile for the icon (Finder alias or POSIX text)
destination [various]: a destination item to set to the icon (Finder alias or POSIX text)
returns [boolean]: true if icon is set, false otherwise
set imageFile to imageFile as text
if imageFile starts with "/" then -- check for POSIX file
set imageFile to imageFile as POSIX file as alias
else
set imageFile to imageFile as alias
end if
set destination to destination as text
if destination does not start with "/" then -- check for POSIX file
set destination to POSIX path of destination
end if
try
tell application "Finder" -- copy the icon image to a temporary file
(duplicate imageFile to (path to temporary items) with replacing) as alias
set tempImage to quoted form of POSIX path of the result
end tell
set tempResource to quoted form of (POSIX path of (((path to temporary items) as text) & "TempResource"))
do shell script "/usr/bin/sips -i " & tempImage -- add a Finder icon to the image
do shell script "/Developer/Tools/DeRez -only icns " & tempImage & " > " & tempResource -- get the icon resource
do shell script "/usr/bin/file " & quoted form of destination -- determine the destination file type
if the result contains "directory" then -- folder
set theTarget to quoted form of (destination & "/Icon" & return) -- create Icon\r file
set Command to "rm " & theTarget & "; " -- remove any existing custom icon
set Command to Command & "/Developer/Tools/Rez -a " & tempResource & " -o " & theTarget & "; " -- add resource file to a folder
set Command to Command & "/Developer/Tools/SetFile -a V " & theTarget & "; " -- make it invisible
else -- file
set Command to "/Developer/Tools/Rez -a " & tempResource & " -o " & quoted form of destination & "; " -- add resource to a file
end if
set Command to Command & "/Developer/Tools/SetFile -a C " & quoted form of destination -- set custom icon attribute
do shell script Command -- do it
on error errmess number errnum -- oops
log errmess
-- display alert "Error " & errnum message errmess buttons {"OK"}
return false
end try
try -- remove temporary files
do shell script "rm " & tempImage & space & tempResource
end try
tell application "Finder" to update (destination as POSIX file)
return true
end setCustomIcon
</pre> -
Custom Icon for Lync Custom Menus
We can create custom menus in LYNC Client by setting some registry values. But we are not able set custom icons fro the same(instead of default ICON). Is there any to set custom Icon for Custom Menus.
Thanks in advance,No the icon is not configurable via the registry values.
-
Custom icons not showing up when I drag a folder into the dock
I have a dock in 10.6 (on the left side, going vertical, if that matters). I've dragged a few folders into it, each containing Aliases to various programs. I've set custom icons on these folders, so I can tell at a glance what's in each folder (since it won't fan out for a vertical dock). But even after I rebooted, the dock isn't showing my custom icons but rather kind of an overlay of the various icons in each folder. What am I doing wrong?
MikeRight-click on the Dock icon>choose Display as Folder
-
Viewlink between Custom VO "Cannot set user query to view"
We have an application where we have extended custom VO and EO’s to get data from flat files. It all looks fine till we create a viewlink for a LOV with two related VO’s. The viewlink VO fails we get message of the form -Cannot set user query to view "CustomVO1" because it is a destination in a view link”. Are there any methods to override in the custom VO/EO or any parameter to be added to configs. Has someone tried this out
Thanks for the update and for sharing the solution!
Regards,
Hussein -
Got help fixing my youtube problem, now that is working. In the process of making the fix, lost my aol set up. Re installed it, but cannot access the icon. How do i get my AOL back?
If it's an application, it should be in the Applications folder. If in doubt, double click on the hardrive icon to open it up, then press Command+F (find) and in the window that comes up for what you want to find, type in AOL and it should appear. You can either drag it to the Dock for easy access or make an alias of that, and drag that alias to the Dock. Oh, and just so's you know, this forum is for Desktop macs only. We may be able to answer your question about a MacBook Pro. Same kind of animal, but different breeds.
good luck
John b -
Custom Icon Not Appear in iTune
I am ready to submit my apps but I am stuck because of one simple problem that I cannot solve.
When I go through Project > Export Release, the custom icon does not show up in iTune, but they are shown in my iPhone, iPod and iPad
The default icon appears in the iTune but not the one I designed.
I have already included the all the different size icons to your build (29, 48, 57, 72, 114, 128 and 512) and see if that solves your problem but this did not solve the problem.
Please help me!
Thank you very much.Hi,
I have tried setting 512x512 image in the app.xml and i was able to get the icon image in iTunes.
If you are using the same icon file in AIR and embedding it to set it dynamically at runtime then you might have an issue. In this case, please create a copy of same image and use it in app.xml file.
Let me know if this helps.
- Hari -
Custom icon for boot camp disk?
I have a Win XP boot camp disk partition (NTFS file system) on an internal hard drive. I want to use a custom icon for this partition on my OS X desktop. However, when I select the icon of this partition in a Get Info window, the only Edit option that ever appears is to Copy the icon. That is, I cannot paste another icon over it (the Paste option is grayed out).
Is this due to the partition being Windows? Is there a way other than the Get Info method for applying a custom icon? I'm using 10.5.2, but the same thing happened with 10.5.1, and also using a fresh test account.Did you know you could have converted the drive to NTFS within Window (not reformatting and losing everything)? I converted mine from FAT32 to NTFS a few months back, lucky for me I already had a drive icon in OSX so the conversion kept the icon.
For your case though, do this:
1) Paste your icon (in the Get Info window) onto a USB thumb drive formatted as FAT32. The name of the drive doesn't matter.
2) Launch Windows through Boot Camp, Parallels Desktop, or VMware Fusion.
3) Open the thumb drive in Windows.
4) Select Folder Options… from the Tools menu, and set it to show invisible files.
5) Copy the two files .VolumeIcon.icns and ._[cr]File, where [cr] is a carriage return, to the NTFS drive. -
Suddenly unable to apply custom icon to system drive?
I've loved using custom drive icons for years, and have routinely changed them to suit my moods. Today, no matter what I try, I cannot change it, and in fact the attempts to apply a new icon have removed my old one, and I now have the standard system icon. I've tried both as the user and as Administator. I've repaired perms.
What's going on?Hi Mike, while I didn't think of it at the time I wrote the above, I now wonder if the Custom icon attribute bit got reset to No, and by using GetInfo and paste changed it back to yes. If you have Developer Tools installed you can test this theory with the GetFileInfo command:
-bash:~francine$ GetFileInfo /Volumes/OXey/
directory: "/Volumes/OXey/"
attributes: avbstClinmed
created: 08/05/2006 20:08:50
modified: 03/08/2007 00:11:16
As I recall, the volume OXey was the one that was having trouble, although now the attribute is set correctly (the upper case C means the item has a custom icon). Recently there have been a rash of cases of drives having the visibility attribute spontaneously changed from v to V, so I guess the custom bit could spontaneously change also. Again, if you have Developer tools installed you can try resetting the bit:
SetFile -a C /Volumes/OXey/
I just went the other way with my drive OXey, turned the bit off, relaunched the Finder and sure enough the custom icon disappeared, even though the .VolumeIcon.icns file was still there. When I turned the bit back on with the above command and relaunched Finder its custom icon reappeared.
If you don't have Developer Tools installed you can download them here:
http://homepage.mac.com/francines/.Public/setgetfile.zip
Unzip and either put the two commands where you want them in you PATH, or just drag each command in turn into the Terminal to use it.
Francine
Francine
Schwieder -
How to set the icon for the entire application with JFrame.setIconImage
I set the icon on the main frame using JFrame.setIconImage(). The icon is shown properly in the main frame.
If more JFrames are opened from the main frame, the newly opened JFrames also show the icon.
However if JDialogs are opended, in some cases the icon set on the main frame is shown and in other cases the coffee cup.
What is JFrame.setIconImage() expected to do? Setting the icon for a single JFrame or the entire application?
How can I set the icon for the entire application?
How can I set the icon for JDialogs?
Thank youIn order for your dialogs to use the same icon as the frame, you must parent the dialogs to the frame which has the custom icon.
See the following thread for more information: http://forum.java.sun.com/thread.jsp?forum=57&thread=362542
cheers,
Greg -
Can't set a icon for a shortcut of a visual studio installer project
hi.
I created a visual studio project (VS 2013, windows 8) from a exist project in the selution, but i can't set the icon on the desktop and program menu.
i tried all the selution i found in the web:
changed the extention to .exe
the size of the icon is 13 k"b, but i still dont see the icon.
i also tried making a shurtcut from Primary Output, with no change.
It should be noted, that in the properties of the shortcot, it shows that there is a icon, and aslo the shortcut works, and ythe icon is showed in the install program, bot the icon is not showed on the desktop and the program menu.hi.
I created a visual studio project (VS 2013, windows 8) from a exist project in the selution, but i can't set the icon on the desktop and program menu.
i tried all the selution i found in the web:
changed the extention to .exe
the size of the icon is 13 k"b, but i still dont see the icon.
i also tried making a shurtcut from Primary Output, with no change.
It should be noted, that in the properties of the shortcot, it shows that there is a icon, and aslo the shortcut works, and ythe icon is showed in the install program, bot the icon is not showed on the desktop and the program menu.
Hello,
It seems that you want to add an icon for your application to be used as a shortcut or an icon located in quick start explorer.
You could add that icon with the following way.
How to: Specify an Application Icon (Visual Basic, C#)
In addition, we should pay attention to the icon format for different systems and different DPI modes.
You could refer to the following thread.
Which icon sizes should my Windows application's icon include?
The following format works for both windows 8 and windows 7.
Windows 7:
Explorer views:
Details / List / Small symbols: 16
All other options: 256 (resized, if necessary)
Right-click->Properties / choosing a new icon: 32
Pinned to taskbar: 32
Right-click-menu: 16
Desktop:
Small symbols: 32
Medium symbols: 48
Large symbols: 256 (resized, if necessary)
Zooming using Ctrl+Mouse wheel: 16, 32, 48, 256
Regards,
Carl
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
Volume erase failed: Media kit reports not enough space on device
I was having problems with the external drive where I store my Time Machine backups, so I tried plugging and unplugging the drive (per earlier advice, and something that had worked in the past), but could not mount the drive. I ran Disk Utility and t
-
Plugin does not load in acrobat 9.5
Hi, I have a plugin that loads in acrobat 8.0.0 but does not load in 9.5 how do i make sure that it gets loaded in 9.5 as well. Thanks
-
No wireless connection on WRT54GS
The wireless connection on my WRT54GS (v6, firmware 1.50.9) seems to have died. The WLAN light still comes on, but neither the downstairs PC nor my PSP can locate the network, even though the router is set to broadcast the SSID. Rebooting makes no di
-
Only Line-Out Audio on TV@anywhere pro ?
Hi, I would like to configure my tv@nywhere pro to use only the line-out jack for for Audio. The audio should not use the soundcard in my computer (XP), because i want to use the soundcard for editing audio..... Any help welcome, Greasel
-
ITunes Library relocation issue
I have to take my iMac in for service and it may be gone for a week. My iTunes Library is on an external drive. It is basically my only source for TV and movies. A week without TV is an awful prospect. I tried hooking up my MacBook Air to the externa