Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

How to change the default icon of a shortcut file on Mac using Java  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String[] cmd = { "ln" "s" ,"sourcePath " ,"destPath" };

try{
Runtime.getRuntime().exec(cmd);
}
catch(IOException y){
System.out.println("Error"+y.getMessage())

I have created a Shortcut using the above code in Mac.
I need to change the default icon of shortcut created .I need to do it using Java.

Thanks
Lucky
 
Lucky Dhar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to change the icon image of shortcut created.

It needs to be implemented in java.

Thanks
Lucky
 
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just googled a bit for this and to me it seems like you'd need to bundle your Java application like a native OS X application and include a plist file that defines the icon to use. This thread also seemed potentially useful.
 
Lucky Dhar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

In my Swing Application,i have created a shortcut to a pdf file on button click .
Now the problem is that it is showing the default icon of Pdf .

I want to change this default Pdf icon and specify my own icon image.

I have used the following code to create a shortcut to a pdf file.

String[] cmd = { "ln", "-s", "/Users/abc/Documents/new.pdf" , "/Users/abc/Desktop/test.pdf" };

Try{
Runtime.getRuntime().exec(cmd)
}
catch(IOException y){
System.out.println("Error"+y.getMessage());

}
I want to change the icon image of pdf shortcut created on button click.


Thanks
Lucky
 
Author and ninkuma
Marshal
Posts: 66801
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along. Please read this for more information.

You can go back and change your post to add code tags by clicking the .
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lucky, you can continue asking the same question here again and again but that won't change the answers.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!