How to Change Icon of  Desktop Application?

Friends, i am developing one small software using Java Desktop Application in Netbeans. I want to change the icon of my application (cup of coffee). I have tried this code: URL url = new URL("myApplication/resourcesresources/camera.png");
Toolkit kit = Toolkit.getDefaultToolkit();
Image img = kit.createImage(url);
this.getFrame().setIconImage(img);
and
URL url = new URL("F:/Documents and Settings/Selva/My Documents/NetBeansProjects/HashCodeCracker/src/myApplication/resourcesresources/camera.png");
Toolkit kit = Toolkit.getDefaultToolkit();
Image img = kit.createImage(url);
this.getFrame().setIconImage(img);
i have searched in google and nothing works . Can anyone solve this problem?
Note:
This code works for me:
Toolkit kit = Toolkit.getDefaultToolkit();
Image frameIcon = kit.getImage("F:\\Documents and Settings\\Selva\\My Documents\\NetBeansProjects\\HashCodeCracker\\src\\hashcodecracker\\resources\\PasswordCrackerIcon.jpg");
this.getFrame().setIconImage(frameIcon);
But i am creating software. So i can not specify the location of the Image in one path. The user may run the software from anywhere. So the above code can not be used.
Thanks
Edited by: Blackstar on Jun 1, 2011 8:46 PM

Blackstar wrote:
Friends, i am developing one small software using Java Desktop Application in Netbeans. I want to change the icon of my application (cup of coffee). I have tried this code: URL url = new URL("myApplication/resourcesresources/camera.png");You really have a directory called <tt>resourcesresources</tt>?
Please use the code tags as described in the sticky post at the top of the forum thread listing.

Similar Messages

  • How to change icons on desktop

    The applicaton icons on my disktop show Apple's generic application icon not the manufactures software icon.  How do I change this?

    You need to be much more specific. Also you shouldn't be storing much on your desktop, Apple advises against that. If you want application icons shown, put them in your Dock.

  • How to change icon of a Folder-track?

    By Folder-track I mean the Folder in Arrange window that is created from "packing reions". Is that even possible in LogicPro7 - to change it's icon?
    I mean I know how to change icons for my audio tracks, audio-instrument tracks. And it would be nice if I can assign different icons for different Folder-tracks.
    I did not find how to do that

    It is possible... use option-command-hold on the icon of the folder in a track in the arrange and up pops the many icons to choose from.
    You can set the icon to something other than the folder.
    To make different folders I guess you would have to do some image editing
    and make your own icons but that is pretty easy.
    Put your user create icons here...
    ~/Library/Application Support/Logic/Images/Icons
    and logic will load your numbered image file instead of the default ones that
    Logic would normaly use.
    Note: 1.png is the file name of the regular folder icon.

  • Hi team, please help me how to deploy creative cloud desktop application through SCCM for an enterprise

    Hi team, please help me how to deploy creative cloud desktop application through SCCM for an enterprise

    Moving this discussion to the Enterprise Deployment for Creative Cloud, Creative Suite forum.

  • How to change Firewall remoted desktop port?

    How to change Firewall remoted desktop port
    I have changed the listening port in the registry.
    I added a rule for incoming for RDT.
    I can find the rules, and other items in the Firewall lists.
    But I cannot find how to edit to change the port number.
    Other threads indicate just added an open port not designating RDT as the program.
    Guidance please.

    >So, when inserting a new rule and choosing RDT from the program list automatically inserts the default port number? 
    My fault.  You should not select RDT from the program list, but instead
    select the radio button for port, then click next, select TCP, and add in
    the port number, then next and continue on with setting allow connection
    and then when does this rule apply.
    Bob Comer

  • How to change photo in desktop icons on macbook pro

    How do i change pictures in desktop icons on MacBook Pro?

    Although this is for Leopard I think it still works for Lion
    Use the applications folder
    See
    http://support.apple.com/kb/ht2493

  • How to change font-size of application menu

    I want to change font-size of application menu. How?

    Hi,
    To change the font size of the Application menu, you need to change main.css file.
    at 'body, td, input, select, textarea' class.
    For more detail about main.css, please refer Bookshelf
    Siebel Developer's Reference at [8 Cascading Style Sheets].
    Regards,
    Joseph Arul Dass

  • How to change icons of a JTree node dynamically

    Hi all!
    I want to change icon associated with a node dynamically ( i.e. after the tree has being displayed). How can i achieve this?
    Can any one provide me a sample code snippet.
    Thanks in advance
    Murali

    I have created CustomCellRenderer and i'm calling this class as follows
    tree.setCellRenderer((TreeCellRenderer) new CustomCellRenderer(true));
    The boolean value for the constructor (in this case it's true) will be set to
    a local variable in the CustomCellRenderer class. Then upon clicking a node in the tree the boolean value (true) is set and the icon for that node should be changed as specified in the CustomCellRenderer class.
    When i click on a node all the icons of that tree are disappearing.
    Can any one help me in this issue
    public class CustomCellRenderer
              extends          JLabel
              implements     TreeCellRenderer
    private ImageIcon          grayfolderImage;
    private ImageIcon          greenfolderImage;
    private ImageIcon          bluefolderImage;
    private ImageIcon          redfolderImage;
    private ImageIcon          whitefolderImage;
    private boolean               bSelected;
    boolean logfileDeleted;
         public CustomCellRenderer()
              grayfolderImage = new ImageIcon("C:\\images\\grayFolder.gif");     
              greenfolderImage = new ImageIcon("C:\\images\\greenFolder.gif");     
              bluefolderImage = new ImageIcon("C:\\images\\blueFolder.gif");     
              redfolderImage = new ImageIcon("C:\\images\\redFolder.gif");
              whitefolderImage = new ImageIcon("C:\\images\\whiteFolder.gif");     
         public CustomCellRenderer(boolean logfileDeleted){
              this.logfileDeleted = logfileDeleted;
         public Component getTreeCellRendererComponent( JTree tree,
                             Object value, boolean bSelected, boolean bExpanded,
                                       boolean bLeaf, int iRow, boolean bHasFocus )
              // Find out which node we are rendering and get its text
              DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
              String     labelText = (String)node.getUserObject();
              this.bSelected = bSelected;
              // Set the correct foreground color
              /*if( !bSelected )
                   setForeground( Color.black );
              else
                   setForeground( Color.red ); */
              // Determine the correct icon to display
              if( labelText.equals( "ioexception001" ) )
                   setIcon( redfolderImage );
              else if( labelText.equals( "ioexception002" ) )
                   setIcon( greenfolderImage );
              else if( logfileDeleted ==true )
                   setIcon( whitefolderImage );
              else if( labelText.equals( "ioexception004" ) )
                   setIcon( redfolderImage );
              else
                   setIcon(bluefolderImage);
              // Add the text to the cell
              setText( labelText );
              return this;
         // This is a hack to paint the background. Normally a JLabel can
         // paint its own background, but due to an apparent bug or
         // limitation in the TreeCellRenderer, the paint method is
         // required to handle this.
         public void paint( Graphics g )
              Color          bColor;
              Icon          currentI = getIcon();
              // Set the correct background color
              bColor = bSelected ? SystemColor.textHighlight : Color.white;
              g.setColor( bColor );
              // Draw a rectangle in the background of the cell
              g.fillRect( 0, 0, getWidth() - 1, getHeight() - 1 );
              super.paint( g );
    }

  • Trouble changing icon in any application, file, etc etc

    I've followed the instructions to change an icon and have done it before with success. But it's not working anymore? Here are the steps i'm doing.... Am I missing something?
    1. right click on icon that i want to use as the "new icon"
    (i believe this is the problem... preview.app is opening the icon. with in get info, the "icon" at the top is just your generic "jpeg" icon. In the "preview" window towards the bottom shows a picture of the icon)
    2. select get info
    3. right click on "icon" at top of preview window
    4. cmd c to copy (also tried copy from file drop down)
    5. repeated step on target app to chang icon
    6. cmnd v to paste (also tried to paste from file drop down)
    doesn't change the icon on the target app or file etc etc....
    signed.... confused?

    OK, try doing both a SMC and PRAM reset and see if either takes care of the problem.
    iMac
    SMC & PRAM Resets
    There are a couple of things you can do before heading off to the Apple store, a SMC and PRAM resets. To do these:
    _SMC RESET_
    • Shut down the computer.
    • Unplug the computer's power cord and all peripherals.
    • Press and hold the power button for 5 seconds.
    • Release the power button.
    • Attach the computers power cable.
    • Press the power button to turn on the computer.
    _PRAM RESET_
    • Shut down the computer.
    • Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    • Turn on the computer.
    • Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    • Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.
    If it still doesn't work then try restarting in Safe Mode, this will clear out some caches which have become corrupted. http://support.apple.com/kb/HT1455

  • How to change icons in Maverick

    Those folders in Maverick look all alike. I cannot quickly see the most important folder
    So I would need to change icons
    Is there a free app for that ?

    - display XtraFinder as a menu
    When XtraFinder is running there's a menu in the Menubar:
    - colorful icons in sidebar
    Put Color Icons Back in Finder Sidebar with SideEffects for 10.9
    Here's the download page: https://www.macupdate.com/app/mac/43078/sideeffects

  • How can I resolve iCal desktop application error message after Yosemite upgrade?

    After upgrading Yosemite on my MacBook Air, MacBook Pro and iMac, my iCloud calendar generates an error message: "The server is currently unreachable or the connection was blocked."
    I am able to create and edit my iCloud calendar events on my iPad, my iPhone, and any browser by signing into iCloud.com.
    All other services such as Mail, reminders, keychain, and so on continue to work normally.
    Other services like Google's Calendar continue to work seamlessly across all mobile devices, web browsers, and the iCal desktop applications.
    I have logged out of iCloud in System Preferences and then logged back, but that did not resolve the issue.
    This is concerning since I am unable to add, edit, or delete events in the iCal desktop software on my computers.
    Any help welcome!

    Found my solution!
    When logging back into iCloud in System Preferences, I received an error message that my (iCloud) account could not verify the "identity" of the "p03-caldev.icloud.com" account.
    I was required to "trust" an Entrust.net Secure Server Certification Authority certificate to remove the error message.
    Everything now synchronizes across iCal on my computers and my mobile devices/icloud.com.

  • 2012R2 VDI how to change "local virtual desktop creation location" for collection

    Hi,
    I want to change "local virtual desktop creation location" for existing collection but this setting is grayed. This location is not exists anymore and I cannot add new VM's to collection.
    If there is no way to do this if it possible to create new collection and move old VM's there?
    Thanks!

    Hi Sergey,
    I assume that you mean virtual desktop storage location, which I don’t think that we can change this setting for an existing collection.
    You can create a new collection, during the creation process, you will be able to select a different storage location for new VMs.
    More information for you:
    Single Image Management for Virtual Desktop Collections in Windows Server 2012
    http://blogs.msdn.com/b/rds/archive/2012/10/29/single-image-management-for-virtual-desktop-collections-in-windows-server-2012.aspx
    Geek of All Trades: VM-Hosted RemoteApps - New Best Practice for Virtual Desktops?
    https://technet.microsoft.com/en-us/magazine/jj554307.aspx
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • N73 How do I change ICONS on DESKTOP

    Hi All,
    Can someone please tell me how to get rid of the 6 "quick icons" on the start screen and the "calender entries" please? All i want is a blank screen......
    There seem to be no welcome screen options anywhere.
    Thanks.
    JC...

    25-Aug-2006
    08:35 PM
    jamcox wrote:
    Great thanks!!!
    All DONE
    Good tips. I was actually trying to restore my icons.
    However, having reactivated the icons I'm now kept awake at night by the flashing blue light which comes in to the bargain.
    Is there anyway of having the icons on my desktop but disabling the flashing light when the phone goes on to standby?

  • How to change icon images in Mavericks?

    I am having difficulty changing some Desktop Icon images in Mavericks.
    Some times I can (Macintosh HD), sometimes I cannot (Applications folder or alias), for example.
    Never had problem prior to 10.9

    To change your Applications folder icon:
    In Finder, press shift-command-G, paste in the following and press Go..
    /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ApplicationsFol derIcon.icns
    Change the name of ApplicationsFolderIcon.icns to ApplicationsFolderIcon.icns.backup
    Confirm this change by selecting Use .backup and enter your password
    Move the .icns file you want to use for your Applications folder and rename it ApplicationsFolderIcon.icns
    Enter your password when prompted
    Restart your computer, open Terminal, type
    killall Finder
    and press return.
    You should have a new Applications folder icon.
    To revert, delete the new file, change the name of the original file back to ApplicationsFolderIcon.icns and follow the rest of the steps above.
    [NB: This change may not stick through future OS updates]

  • How to remove icon from desktop

    I have added an external hard drive (for back up.)   It has a USB connection.  Its icon appears on my desktop.  It is only so much clutter, and I would like to make it disappear, as I have done with the icon of the internal HD.  Can that be done?  If so, how?

    You do it the same way you did with your internal HD.
    Finder -> Preferences -> General -> Show these items on the desktop -> External disks

Maybe you are looking for

  • I had to disconnect my My Book USB to G5, firewire to external hard drive

    I had this hard drive formated journaled whatever was recommended and it has been used to drag all photos off my full G5 internal drive which has only a 80GB hard drive. I have added a second internal drive and have successfully formated it and it sh

  • How Can I Add Acrobat 9 as a Printer? (Mac)

    Hi All, I installed the Master Collection yesterday after having used the Design Premium suite. However, having just completed an InDesign document I noticed that "Adobe PDF" is no longer available in my list of printers and for the life of me I can'

  • Should i go for macbook pro 13" or air 13"

    hey guys, now that i've been new macbook pro has come out light, thinner and with extra 4GB RAM, i just do not know if i should get macbook air or pro. I am a college student where power ports are readily available in my campus. so battery life of 7~

  • Create a copy of active database using T-SQL.

    I have a requirement to create a copy of existing active (currently in use) database through code. I need to copy all objects which include tables, stored procs, triggers, functions, foreign keys, constraints, primary keys, etc... from source DB to n

  • Yahoo Games Font un-readable

    Hey all, I have no idea what has happened to my safari but when I try to go to a yahoo games page, such as pool. I end up getting some weird font and the game is totally unplayable. how can I change the font that the safari uses while using java to I