wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes about splash screen with jar file... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "about splash screen with jar file..." Watch "about splash screen with jar file..." New topic
Author

about splash screen with jar file...

Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

META-INF/
META-INF/MANIFEST.MF
images/
images/power.JPG
images/splash.jpg
poweroff/
poweroff/about.gif
poweroff/cancel.gif
poweroff/Main$1.class
poweroff/Main.class
poweroff/ok.gif
poweroff/powerOffGUI$1.class
poweroff/powerOffGUI$2.class
poweroff/powerOffGUI$3.class
poweroff/powerOffGUI$4.class
poweroff/powerOffGUI$5.class
poweroff/powerOffGUI$6.class
poweroff/powerOffGUI$7.class
poweroff/powerOffGUI$checkStatus.class
poweroff/powerOffGUI$mouseHandler.class
poweroff/powerOffGUI$showTime.class
poweroff/powerOffGUI.class
poweroff/windowTheme.class

********************************************************************************
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.6.0-b105 (Sun Microsystems Inc.)
SplashScreen-Image: images/splash.jpg
Main-Class: poweroff.Main
********************************************************************************

the contents of jar file and manifest file are shown above....

java -splash:images\splash.jpg -jar poweroff.jar (producing splash screen)
java -splash:images\splash.jpg poweroff.Main (producing splash screen)
java -jar poweroff.jar (working but not producing splash screen)

without -splash option, this jar file does'nt giving splash screen...
although, we add the SplashScreen: option to the manifest file, why this jar file is not creating splash screen??

is this specification of splash image in manifest file is correct??
how to solve this problem...?
please explain... thank you.
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3011
    
  34

sanjeev charla wrote:although, we add the SplashScreen: option to the manifest file,

It should be "SplashScreen-Image:"
SplashScreen-Image: images/splash.jpg

Devaka


Founder of ExamLab and Systemup
See how I can help you to become an awesome programmer
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Isn't that exactly what Sanjeev posted?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3011
    
  34

Rob Prime wrote:Isn't that exactly what Sanjeev posted?


Ooops! my eyes
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

and finally, what will be the solution???
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90


later, a class is implemented to show the splashscreen instead of using splashscreen option by Java6.

in that code, the JLabel is created with an image as follows..

ImageIcon image=new ImageIcon("images/splash.jpg");
JLabel imageLabel=new JLabel(image);


the directory structure of netbeans folder is..

build/
build.xml
dist/
images/<-- splash.jpg
nbproject/
src/
test/


it works fine when running program in netbeans...
but the jar file in dist/ folder is not performing well...

there is no images/ folder in jar file created by netbeans,and also the Main-Class: option is not added in manifest file.
later i added images/ folder to jar file and Main-Class location as follows..

images/
META-INF/
poweroff/

but again the jar is working with out using the splash image in images/ folder.

but if i place the images/ folder in the directory , where the jar file is located.. then it works fine... like this..

dist/
dist/images/
dist/poweroff.jar

what is the problem.....??? thanks....
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4164
    
  21

sanjeev charla wrote:
it works fine when running program in netbeans...
but the jar file in dist/ folder is not performing well...

there is no images/ folder in jar file created by netbeans,and also the Main-Class: option is not added in manifest file.
later i added images/ folder to jar file and Main-Class location as follows..


Then it appears your not exporting the code to a JAR file properly in Netbeans. Try building the JAR file manually. Then, when you have that working figure out how to export to a JAR file with the images directory in the proper place, and the manifest the way it needs to be. Read this tutorial page on setting up the SplashScreen.

It may be that you have to import the image into the NetBeans project a specific way, rather than just copying it to a folder (I don't know I don't use NetBeans). Or it might be that you are not running through a 'Jar Export Wizard' with the proper options selected.


Steve
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37884
    
  22
Getting too difficult a topic for us beginners. Moving. Since this may be a NetBeans problem, I'll try the IDEs forum in the first instance.
 
Don't get me started about those stupid light bulbs.
 
subject: about splash screen with jar file...
 
Similar Threads
Executable jar that contains other jars
Splash screen image
user.dir
options in jar files....
manifest file