• 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

about splash screen with jar file...

 
Ranch Hand
Posts: 90
Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Isn't that exactly what Sanjeev posted?
 
Devaka Cooray
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic