• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

to make an icon for application.

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i hv made an application in java , now i want to make an icon for my application , so that i shuld b able to insall it on any system, plz reply
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly do you mean?

Are you talking about how to set icon for an application?

In windows make a batch file that ivokes your application using javaw application launcher. Then make a shortcut to the bacth file and set an icon for the shortcut.

In Linux create a launcher that invokes the java command for your application and set an icon for the launcher.

Or you are talking about how actually create an image icon for your application?

Use any image editor like Paint, or Gimp or Photoshop, that's it.
 
amit bharwani
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanx edwin for ur kind support , actually i hv made an application , its jar file, now i want to know what shud b the contents of bat file. thanx again keep replying
[ June 03, 2006: Message edited by: amit bharwani ]
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well in the notepad or any other text editor create a file named myapp.bat or the name that you want to give to your application.

Write in it:

@echo off
javaw -cp myjar.jar com.mydomain.myApp

And that's it. This file can be executed by means of double-clicking it. Now make a sorthcut to it and put it in your desktop. Set an icon for your shortcut by means of right-clicking on it and setting its properties.

Make sure that javaw is your OS path.

Good luck!
 
Ranch Hand
Posts: 1170
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can't you just double click the jar file to make it run on modern JREs?
 
amit bharwani
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanx mr edwin. really for ur kind support,i want to know one more thin. i want to instal my applications on other system and when application is installed, and if end user wants then its icon being displayed on desktop or any other specified location
 
amit bharwani
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello Mr. C Lamont Gilbert i tried the samethin but it didnt work on my pc. thanx for replyin
 
amit bharwani
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello mr edwin,
i did the same thing as u mentioned i.e i made jar file named xyz.jar bat file named run.bat and its contents were
@echo off
javaw -classpath c:\xyz.jar com.mydomain.run
message was displayed that no main class found
plz reply
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by amit bharwani:
i want to make an icon for my application , so that i shuld b able to insall it on any system, plz reply



Your question is not clear. If you want a platform indpendent java installer you can take a look at http://www.install4j.com or http://www.izforge.com/izpack/

If you want an _icon_ for your application to show up in the Windows explorer or the OS X finder that's a different question: On Windows I suggest launch4j.sf.net and to use the 'Jar Bundler' on OS X (google for "application bundle" and Java on the apple homepage if you don't have a Mac). This will assure that your jar is packaged (in OS X) or has an additional launcher (on Windows) which shows an icon and also assures that your java app can be identified in the task manager with a unique name (instead of java.exe or javaw.exe on Windows). I don't know a Linux solution for that. If you want to have an icon _inside_ your jar so that your application will have a unique icon in the windows task bar or when Alt-Tab-switching between programs you'll have to add this icon extra. One possible way is:

setIconImage(new ImageIcon(getClass().getResource("/resources/Icon.gif")).getImage());

(assuming the Icon.gif file is in the resources directory).

To the moderators... shouldn't this be a FAQ? :-)

Best regards
Peter
 
amit bharwani
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanx mr. peter,
i made jar file of my application , then a bat file, when i open this bat file then a messg. is displayed that main class not found instead of displayin output of program , once this bat file runs , i can put this on desktop and change its icon,
plz reply
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
amit i think u should first try to clearly explain what do u exactly want ur desires are still not clear
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Folks, please rd ths!

Now: don't know what this is doing in "advanced Java." It'd be more at home in the beginner forum, which is where it's going.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic