• Post Reply Bookmark Topic Watch Topic
  • New Topic

to make an icon for application.  RSS feed

 
amit bharwani
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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!
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
 
Peter Karp
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
sushil bharwani
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!