Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about splash screen with jar file...

 
Sanjeev Charla
Ranch Hand
Posts: 90
Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 4508
270
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sanjeev charla wrote:although, we add the SplashScreen: option to the manifest file,

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

Devaka
 
Rob Spoor
Sheriff
Pie
Posts: 20550
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't that exactly what Sanjeev posted?
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4508
270
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:Isn't that exactly what Sanjeev posted?


Ooops! my eyes
 
Sanjeev Charla
Ranch Hand
Posts: 90
Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and finally, what will be the solution???
 
Sanjeev Charla
Ranch Hand
Posts: 90
Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49405
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic