Java Splash Screen

Hey Everyone,
I can't for the life of me get the Java SpashScreen to work. I have tried to run the example provided at [http://docs.oracle.com/javase/tutorial/uiswing/misc/splashscreen.html] however no matter how I try to run it i always get a java.lang.NoClassDefFoundError. Any ideas as to what I am doing wrong.
I would eventually like to package my splash screen into a jar file for my application but first I would like to get the demo to work.
Thanks,
Nath5

I think where you are going wrong is when you assume that error message has something to do with the fact that you're trying to use a splash screen. Since splash screens only display an image and don't require loading any classes, I would expect that messages about failing to load a class aren't related to your use of splash screens.

Similar Messages

  • Java 1.5 Update 6 Splash Screen

    I have a client who operates in a dark space and does not want bright white backgrounds or white splash screens. It is easy enough to use BGCOLOR="black" in the body tag of the applet containers. However, the Sun animated splash screen logo is my last challenge. I don't want to get rid of it so much as I want to color it a dark shade of grey or black. Anyone know if it is possible to darken the color of the background on the "Java Loading" splash screen ?

    You may have video problems. Check for the most current video driver version (from the video card provider, not the computer supplier.)

  • Java6 splash screen in java webstart

    I can't get the java 6 splash screen working when running as a webstart application .
    I don't mean the splash you get while downloading but the one that's been introduced in java 6 that's showing while your app is starting.
    So far I tried adding it in the manifest file of the main jar, adding the classpath switch in the jnlp file , adding the classpath switch in the JAVAWS_VM_ARGS but none worked.
    Is there any documentation on this ? Or how should it work ?
    Bart

    Here's a very simple version:
    public class SplashScreen extends JWindow {
        public SplashScreen () {
          JLabel image = new JLabel(new ImageIcon(SplashScreen.class.getResource("icons/splash.gif")));
          this.getContentPane().add(image, null);
          this.pack();
          Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          Dimension imageSize = image.getPreferredSize();
          this.setLocation(screenSize.width/2 - (imageSize.width/2),     screenSize.height/2 - (imageSize.height/2));
          this.setVisible(true);
    }This assumes a sub-folder in the same folder as your SplashScreen class named icons, containing a file splash.gif.
    You will need to dispose() of the SplashScreen object when you have finished with it.

  • HT5945 new macbook pro loaded with mavericks. installed CS3 including prompted Java update. try to open photoshop &  empty splash screen pops up-can't go further. tried newer java update-same result. re-opened 4 times-same. help!!

    new macbook pro loaded with mavericks. installed CS3 including prompted Java update. try to open photoshop &  empty splash screen pops up-can't go further. tried newer java update-same result. shut down 4 times-same. any suggestions?

    Kappy wrote:
    Has it occurred to you that CS3 isn't compatible with Mavericks? Try using CS9 or 10.
    Sorry that's untrue. I have Photoshop CS3 running on 10.9.
    CS9 or 10? Now you are just making stuff up.
    Adobe claim CS3 will work, with a minor issue…
    http://helpx.adobe.com/x-productkb/global/mac-os-mavericks-compatability.html
    The Adobe updater fails to work for me.
    I was prompted to install J6RE which came from Apple, check the Apple support downloads http://support.apple.com/downloads/#java%206
    Sorry can't provide a direct link, it was just a dumb 'You need … please click install' dialog.
    I think the 10.9 java updater is installing version 7.

  • Splash Screen generates   java.lang.NoClassDefFoundError: Eapply errors.

    Hi Everyone,
    Again, I am new to Java (2nd month actually coding) and don't know of a better place to post this problem. Also, the forum does not have a search feature (that I can see) so I apologize if this issue has been raised and discussed before (which it probably has been).
    I am trying to utilize the new splash screen facility in SE 6 but have run into a problem. The image will display just fine but I get 'class not found' exceptions immediately afterwards. It seems as if the launcher cannot see the class containing main.
    I guess I need to mention the fact that I am using the Galileo version of Eclipse. I checked the project settings and confirmed that the class, in this case, Eapply, is in fact in the class path so I am at a loss as to why it cannot be found. My code reads pretty much like every example I have seen of the splash screen functionality, so I can only imagine that the problem lies within environmental settings or something else I am not taking into account.
    Here is the code I am using minus any lines not necessary to illustrate the problem:
    Command line
    -splash:images/vessels.jpg Eapply
    Class
    public class Eapply extends App implements ActionListener {
         public Eapply() throws SQLException {
              super("E-Apply Electronic Application", App.getCompanyID(), true);
         public static void main(String[] args) throws SQLException, ParseException {
              eapp = new Eapply();     
    The stack trace
    Exception in thread "main" java.lang.NoClassDefFoundError: Eapply
    Caused by: java.lang.ClassNotFoundException: Eapply
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
    Any suggestions you can offer will be greatly appreciated.
    Thank You,
    Ricky

    RickyM wrote:
    I fixed the problem. Seems as if the classpath, while being launched within Eclipse, was correct. However, the classpath was not set correctly if you tried to launch the app from outside of eclipse. To fix the problem, I specified the -classpath option on the command line.That's a very typical problem, and one reason why IDE's should not become addictive to the point that you can't do anything without it. Yes the IDE handles setting the classpath for you. But of course the actual users running the software will not be using an IDE to run it, so you must become very acquainted with what the classpath is and how to use it.

  • How can I customize the Java Report Panel applet splash screen?

    Has anyone found a quick and easy way, either via javascript or a webi properties file, to cutomize the splash screen for the Java Reporting Panel applet while it is loading?  I've found a few code snippets for the javascript approach, but they don't quite work, and apparently there's a webi properties file that I should be able to use to accomplish this, but where is it exactly?  Is it on the BO server, or should it be in a jar file in my project.  Can't seem to find it.  Thanks for any help.

    Look at the link I posted, you aren't double buffering correctly.
    I saw the other post you mistakenly made before you edited it. Not really a big deal, I was just wondering why you did that.

  • After Effects CS5.5 - Lion: Crash on splash screen EXC_BAD_ACCESS (SIGABRT)

    So one day, out of the blue, After Effects stops wanting to open. The worst part is, I can't think of any changes that would have caused this.
    I am running After Effects CS5.5 (10.5.1) on my MacBook Pro 13" (Early 2011), which is running Mac OSX Lion. Here is my system profile (with some sections omitted).
    Just a few weeks ago, I began to consistently receive this message during the AE splash screen:
    After Effects Alert
    Last log message was: <140735295236448> <ASL.ResourceUtils.GetLanguageIDFromRegistry> <0> Unable to obtain the User 'Language' registry key at: Software\Adobe\After Effects\10.5.1\ Defaulting to 'en_US'.
    Here is a crash log.
    Any ideas?
    First attempt
    I figured maybe I had a bad preference file, so I cleared my prefs. Nothing changed aside from a modified error message:
    After Effects Alert
    Last log message was: <140735295236448> <DynamicLink> <5> 0x114ee8418
    And a crash log.
    Also, if I try opening AE again, after I cleared my prefs and opened it once, the error message returns to the "registry key" alert.
    Second, third, fourth attempt
    So I uninstalled and reinstalled After Effects about 3 times. No change. I used the latest download from Adobe, and the original Master Collection image: no difference.
    Fifth attempt
    I created a second admin account to see if this was an isolated issue. It isn't; same problem.
    Sixth attempt
    I thought about QuickTime, so I opened up System Prefs, and uninstalled Perian. I left the prefpane there though.
    Also, I have the latest version of Java.
    Seventh attempt (Added 19 March 2012)
    I used the Adobe Creative Suite Cleaner Tool to wipe out my entire Adobe installation. I still have the same problem after a reinstall. I'm going to try installing AE on my external drive next. This is really frustrating. Has anyone experienced this issue and found a resolution?
    Notes
    Interestingly enough, all of the other Abobe CS5.5 apps I installed work fine:
    Bridge
    Photoshop
    Illustrator
    InDesign
    Premiere Pro
    OnLocation
    Extension Manager
    Added 1:54PM, 13 March 2012:
    Also, opening up the render engine causes the same error message.

    I just installed AE, have never used it, and am seeing it bail on startup with the same odd language registry key error. Please see my post on a related thread.
    Any luck here? Would be nice to get AE to boot so I could evaluate it.

  • SQL Developer locks after splash screen

    I have succesfully installed SQL Developer on 2 machines in our group and it works fine. However on the machine where we really need it (mine) it absolutely refuses to work.
    It appears to start up, the splash screen appears and the sqldeveloper.exe appears in the machine's task list but thats it! The splash screen stays on the screen until I click on it and then disappears.
    I have tried the version with the built in SDK and I have also downloded the SDK from Sun and tried the version without the accompanying SDK. I have also de-installed all the Java SDK and runtime versions on the machine and re-installed those that were needed. Same result.
    At this stage I called in our Java development guru who twiddled and tweaked during 30 minutes...same result.
    If I execute sqldeveloper.exe from within the jdev\bin folder I see the following in a DOS box:
    java.lang.NullPointerException
    at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:11
    at javax.swing.UIDefaults.getUI(UIDefaults.java:721)
    at javax.swing.UIManager.getUI(UIManager.java:860)
    at javax.swing.JPanel.updateUI(JPanel.java:104)
    at javax.swing.JPanel.<init>(JPanel.java:64)
    at javax.swing.JPanel.<init>(JPanel.java:87)
    at javax.swing.JPanel.<init>(JPanel.java:95)
    at javax.swing.JRootPane.createGlassPane(JRootPane.java:482)
    at javax.swing.JRootPane.<init>(JRootPane.java:313)
    at javax.swing.JFrame.createRootPane(JFrame.java:247)
    at javax.swing.JFrame.frameInit(JFrame.java:228)
    at javax.swing.JFrame.<init>(JFrame.java:195)
    at oracle.ide.IdeCore$StartupWindow.<init>(IdeCore.java:1458)
    at oracle.ide.IdeCore.startupImpl(IdeCore.java:1084)
    at oracle.ide.Ide.startup(Ide.java:672)
    at oracle.ideimpl.Main.start(Main.java:49)
    at oracle.ideimpl.Main.main(Main.java:25)
    but I don't know if this is really relevant as that is not the normal start path.
    The machine/OS spec is as follows:
    OS Name     Microsoft Windows XP Professional
    Version     5.1.2600 Service Pack 1 Build 2600
    OS Manufacturer     Microsoft Corporation
    System Name     XP224
    System Manufacturer     Hewlett-Packard
    System Model     HP Compaq dc7100 CMT(PC928A)
    System Type     X86-based PC
    Processor     x86 Family 15 Model 3 Stepping 4 GenuineIntel ~2992 Mhz
    Processor     x86 Family 15 Model 3 Stepping 4 GenuineIntel ~2992 Mhz
    BIOS Version/Date     Hewlett-Packard 786C1 v01.05, 16/06/2004
    SMBIOS Version     2.3
    Windows Directory     C:\WINDOWS
    System Directory     C:\WINDOWS\System32
    Boot Device     \Device\HarddiskVolume1
    Locale     United Kingdom
    Hardware Abstraction Layer     Version = "5.1.2600.1106 (xpsp1.020828-1920)"
    Time Zone     Romance Daylight Time
    Total Physical Memory     512.50 MB
    I would be very grateful for any suggestions anyone may have as to the nature of this problem.
    Thanks
    Paul BJ

    See post:
    java.lang.NullPointerException
    Regards,
    Eric

  • Is there a way to speed up the "Java Loading" screen time?

    Hi.
    I'm having a big problem with that. I'm running the JRE 1.6u3 on Windows XP SP 2, on an AMD Athlon 64 X2 Dual 3800+ (2GB of RAM), and the "Java Loading" screen time of web started apps is too high (about 15 seconds when I just restarted the pc, and 10 seconds after the first load... is that right?).
    What Web Start do when it is "loading" ? The loading time of a standard client VM is pretty faster (like, uh, 1/4 second?).
    Thanks.
    Hidralisk

    The Java Loading splash is only shown untill the Main class of java web start is invoked and can put up the download progress dialog. I don't know why it would be so sow, but this should be improved by the Java Quick Start featurew put in jdk 6u10 (see http://download.java.net/jdk6/)
    the bug 6506138 has been escallated and is being vigorously investigated. (it would probably pertain more to the time durring which the download progress window is shown or beyond)
    /Andy

  • Splash screen with progress bar and multiple jar files to load

    Hello,
    I have been looking to the new features in java 6 for splash screens. I haven't implemented this never before and i was wondering how i could do the following with java 1.5 or 6:
    I would like to see a splash screen with a progress bar that "grows" when every jar file has been read.
    At this time i call my application like this from a shell script:
    exec "$JAVA_BIN" -Djava.library.path=$LIBRARIES_J3D -classpath xxxx.jar yyyy.jar zzzz.jar ...
    where xxx.jar, yyy.jar and zzz.jar are very heavy jars.
    So i would like to see in the progress bar 33% 66% and 100% when they are loaded.
    I do not know if this is the right forum to ask for this. If no, please point me which would be the ideal one.
    Any help will be very useful. Thanks to all!

    Am 10.07.2015 um 07:17 schrieb Lalit Solanki:
    > Hi friend,
    >
    > I am create pure eclipse E4 application and trying to splash screen with progress bar and message.
    >
    >
    >
    >
    > but above image in only support eclipse E3 application so pleas help me how to add progress bar and message in eclipse E4 application
    >
    Hi Lalit,
    there's a Bug entry: https://bugs.eclipse.org/bugs/show_bug.cgi?id=382224
    Meanwhile you can use this solution:
    https://www.eclipse.org/forums/index.php/t/328812/5ceed4bcaa683a94d65efb161bffd217/
    Regards,
    Ralf.

  • Splash screen ABAP (Was 6.20) SAPGui 6.20

    I love splash screens. A small pop-up window with a picture should come for say 5  to 10 seconds and disappear by a timer task.
    Giving such timer splash screens at START or END makes the application attractive. I do it in VB PB & Java.
    How to do Slash screen in ABAP SAP GUI 6.20 WAS 6.20?
    Should be thrown up as a "floating" popup.
    Regards & Hopeful
    -jnc

    With good tips from Thomas Jung
    I made 2 function modules to suit my whims.
    SAP being a serious Businesss Software you cannot have too many JPGs floating around! One or two is fun.
    In Function group uou need two screens 0806 & 2009 which are essentially blank.
    I put 2 title Bars - 0806 "SAP - JOB in Progress"; 2009 - "SAP - JOB OVER!!"
    Code listing for function: ZJNC_START_SPLASH
    Description: Show Splash at Start
    FUNCTION zjnc_start_splash.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(IMAGEFILE) TYPE  C DEFAULT 'THANKS.JPG'
    *"     REFERENCE(WIDTH) TYPE  I DEFAULT 415
    *"     REFERENCE(HEIGHT) TYPE  I DEFAULT 274
    *"     REFERENCE(TIMEOUT) TYPE  I DEFAULT 3
    *"     REFERENCE(CALLBACK) TYPE  C
          Global data declarations
      MOVE imagefile TO g_name.
      MOVE width TO picwidth.
      MOVE height TO picheight.
      MOVE timeout TO pictimeout.
      MOVE callback TO piccallback.
      TRANSLATE piccallback TO UPPER CASE.
      PERFORM getpicurl.
      CALL SCREEN 0806.
    ENDFUNCTION.
    Code listing for function: ZJNC_END_SPLASH
    Description: Show Splash at End
    FUNCTION ZJNC_END_SPLASH.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(IMAGEFILE) TYPE  C DEFAULT 'THANKS.JPG'
    *"     REFERENCE(WIDTH) TYPE  I DEFAULT 415
    *"     REFERENCE(HEIGHT) TYPE  I DEFAULT 274
    *"     REFERENCE(TIMEOUT) TYPE  I DEFAULT 3
          Global data declarations
      MOVE imagefile TO g_name.
      MOVE width TO picwidth.
      MOVE height TO picheight.
      MOVE timeout TO pictimeout.
      PERFORM getpicurl.
      CALL SCREEN 2009.
    ENDFUNCTION.
    Code listing for: LZUTILTOP
    TOP level Include of Function Group ZUTIL
    Author Jayanta Narayan Choudhuri
            Flat 302
            395 Jodhpur Park
            Kolkata 700 068
          Email [email protected]
          URL:  http://www.geocities.com/ojnc
    FUNCTION-POOL zutil.                        "MESSAGE-ID ..
    TYPE-POOLS: abap.
    DATA: graphic_url(255),
          g_result   TYPE i,
          g_linesz   TYPE i,
          g_filesz   TYPE i,
          g_name(100).
    TYPES: t_graphic_line(256) TYPE x.
    DATA: graphic_line TYPE t_graphic_line,
          graphic_table TYPE TABLE OF t_graphic_line.
    DATA: picwidth        TYPE i,
          picheight       TYPE i,
          pictimeout      TYPE i,
          piccallback(60) TYPE c,
          first           TYPE boolean.
          CLASS ZCL_ES_SPLASH_SCREEN  DEFINITION
    CLASS zcl_es_splash_screen DEFINITION.
      PUBLIC SECTION.
        EVENTS on_close.
        METHODS constructor
          IMPORTING
            !i_num_secs  TYPE i DEFAULT 5
            !i_url       TYPE c
            !i_width     TYPE i
            !i_height    TYPE i.
      PROTECTED SECTION.
        METHODS handle_end_of_timer
          FOR EVENT finished OF cl_gui_timer.
      PRIVATE SECTION.
        DATA container TYPE REF TO cl_gui_dialogbox_container.
        DATA image     TYPE REF TO cl_gui_picture.
        DATA timer     TYPE REF TO cl_gui_timer.
    ENDCLASS.                    "ZCL_ES_SPLASH_SCREEN  DEFINITION
    CLASS ZCL_ES_SPLASH_SCREEN IMPLEMENTATION
    CLASS zcl_es_splash_screen IMPLEMENTATION.
      METHOD constructor.
        DATA: image_width     TYPE i,
              image_height    TYPE i.
        COMPUTE image_width  = i_width + 30.
        COMPUTE image_height = i_height + 50.
        CREATE OBJECT container
           EXPORTING
             width                       = 10
             height                      = 10
             top                         = 10
             left                        = 10
             name                        = 'DialogSplash'.
        CALL METHOD container->set_caption
          EXPORTING
            caption = g_name.
        CREATE OBJECT image
          EXPORTING
            parent = container.
        CALL METHOD image->load_picture_from_url
          EXPORTING
            url = i_url.
        image->set_display_mode( image->display_mode_normal_center ).
        cl_gui_cfw=>flush( ).
        container->set_metric( EXPORTING metric = image->metric_pixel ).
        DATA: myleft TYPE i,
              mytop  TYPE i.
        COMPUTE myleft = ( 800 - image_width ) / 2.
        COMPUTE mytop  = ( 600 - image_height ) / 2.
        IF myleft < 0.
          MOVE 0 TO myleft.
        ENDIF.
        IF mytop < 0.
          MOVE 0 TO mytop.
        ENDIF.
        container->set_position(
          EXPORTING
            height            = image_height
            left              = myleft
            top               = mytop
            width             = image_width ).
        cl_gui_cfw=>update_view( ).
        CREATE OBJECT timer.
        timer->interval = i_num_secs.
        SET HANDLER me->handle_end_of_timer FOR timer.
        timer->run( ).
        cl_gui_cfw=>flush( ).
      ENDMETHOD.                    "constructor
      METHOD handle_end_of_timer.
    I wanted NAMASTE to remain until JOB was complete.
       IF container IS NOT INITIAL.
         container->free( ).
         CLEAR container.
         FREE  container.
       ENDIF.
       IF timer IS NOT INITIAL.
         timer->free( ).
         CLEAR timer.
         FREE  timer.
       ENDIF.
       cl_gui_cfw=>flush( ).
        RAISE EVENT on_close.
      ENDMETHOD.                    "handle_end_of_timer
    ENDCLASS.                    "ZCL_ES_SPLASH_SCREEN  IMPLEMENTATION
          CLASS lcl_event_handler DEFINITION
    CLASS lcl_event_handler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS: on_close FOR EVENT on_close OF zcl_es_splash_screen.
    ENDCLASS. "lcl_event_handler DEFINITION
    CLASS lcl_event_handler IMPLEMENTATION
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD on_close.
        IF sy-dynnr = 2009.
          LEAVE PROGRAM.
        ELSE.
          MOVE abap_false TO first.
          PERFORM (piccallback) IN PROGRAM (sy-cprog).
        ENDIF.
      ENDMETHOD. "on_close
    ENDCLASS. "lcl_event_handler IMPLEMENTATION
    DATA: splash TYPE REF TO zcl_es_splash_screen.
    *&      Module  STATUS_0806  OUTPUT
    MODULE status_0806 OUTPUT.
      IF first IS INITIAL.
        first = abap_true.
        SET TITLEBAR 'TITLE0806'.
        CREATE OBJECT splash
            EXPORTING
              i_num_secs = pictimeout
              i_url      = graphic_url
              i_width    = picwidth
              i_height   = picheight.
        SET HANDLER lcl_event_handler=>on_close FOR splash.
      ENDIF.
    ENDMODULE.                " STATUS_0806  OUTPUT
    *&      Module  STATUS_2009  OUTPUT
    MODULE status_2009 OUTPUT.
      IF first IS INITIAL.
        first = abap_true.
        SET TITLEBAR 'TITLE2009'.
        CREATE OBJECT splash
            EXPORTING
              i_num_secs = pictimeout
              i_url      = graphic_url
              i_width    = picwidth
              i_height   = picheight.
        SET HANDLER lcl_event_handler=>on_close FOR splash.
      ENDIF.
    ENDMODULE.                " STATUS_2009  OUTPUT
    *&      Form  getpicurl
    FORM getpicurl.
      OPEN DATASET g_name FOR INPUT IN BINARY MODE.
      REFRESH graphic_table.
      CLEAR   g_filesz.
      DO.
        CLEAR graphic_line.
        READ DATASET g_name INTO graphic_line ACTUAL LENGTH g_linesz.
        ADD g_linesz TO g_filesz.
        APPEND graphic_line TO graphic_table.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET g_name.
      CLEAR graphic_url.
      CALL FUNCTION 'DP_CREATE_URL'
        EXPORTING
          type                 = 'IMAGE'
          subtype              = 'GIF'
        TABLES
          data                 = graphic_table
        CHANGING
          url                  = graphic_url
        EXCEPTIONS
          dp_invalid_parameter = 1
          dp_error_put_table   = 2
          dp_error_general     = 3
          OTHERS               = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
    ENDFORM.                    "getpicurl
    Extracted by Direct Download Enterprise version 1.2 - E.G.Mellodew. 1998-2004 UK.

  • Useful Code of the Day:  Splash Screen & Busy Application

    So you are making an Swing application. So what are two common things to do in it?
    1) Display a splash screen.
    2) Block user input when busy.
    Enter AppFrame! It's a JFrame subclass which has a glass pane overlay option to block input (setBusy()). While "busy", it displays the system wait cursor.
    It also supports display of a splash screen. There's a default splash screen if you don't provide a component to be the splash screen, and an initializer runner which takes a Runnable object. The Runnable object can then modify the splash screen component, for example to update a progress bar or text. See the main method for example usage.
    It also has a method to center a component on another component (useful for dialogs) or center the component on the screen.
    NOTE on setBusy: I do recall issues with the setBusy option to block input. I recall it having a problem on some Unix systems, but I can't remember the details offhand (sorry).
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    * <CODE>AppFrame</CODE> is a <CODE>javax.swing.JFrame</CODE> subclass that
    * provides some convenient methods for applications.  This class implements
    * all the same constructors as <CODE>JFrame</CODE>, plus a few others. 
    * Methods exist to show the frame centered on the screen, display a splash
    * screen, run an initializer thread and set the frame as "busy" to block 
    * user input. 
    public class AppFrame extends JFrame implements KeyListener, MouseListener {
          * The splash screen window. 
         private JWindow splash = null;
          * The busy state of the frame. 
         private boolean busy = false;
          * The glass pane used when busy. 
         private Component glassPane = null;
          * The original glass pane, which is reset when not busy. 
         private Component defaultGlassPane = null;
          * Creates a new <CODE>AppFrame</CODE>. 
         public AppFrame() {
              super();
              init();
          * Creates a new <CODE>AppFrame</CODE> with the specified
          * <CODE>GraphicsConfiguration</CODE>. 
          * @param  gc  the GraphicsConfiguration of a screen device
         public AppFrame(GraphicsConfiguration gc) {
              super(gc);
              init();
          * Creates a new <CODE>AppFrame</CODE> with the specified title. 
          * @param  title  the title
         public AppFrame(String title) {
              super(title);
              init();
          * Creates a new <CODE>AppFrame</CODE> with the specified title and
          * <CODE>GraphicsConfiguration</CODE>. 
          * @param  title  the title
          * @param  gc     the GraphicsConfiguration of a screen device
         public AppFrame(String title, GraphicsConfiguration gc) {
              super(title, gc);
              init();
          * Creates a new <CODE>AppFrame</CODE> with the specified title and
          * icon image. 
          * @param  title  the title
          * @param  icon   the image icon
         public AppFrame(String title, Image icon) {
              super(title);
              setIconImage(icon);
              init();
          * Creates a new <CODE>AppFrame</CODE> with the specified title and
          * icon image. 
          * @param  title  the title
          * @param  icon  the image icon
         public AppFrame(String title, ImageIcon icon) {
              this(title, icon.getImage());
          * Initializes internal frame settings. 
         protected void init() {
              // set default close operation (which will likely be changed later)
              setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              // set up the glass pane
              glassPane = new JPanel();
              ((JPanel)glassPane).setOpaque(false);
              glassPane.addKeyListener(this);
              glassPane.addMouseListener(this);
          * Displays a new <CODE>JWindow</CODE> as a splash screen using the
          * specified component as the content.  The default size of the
          * component will be used to size the splash screen.  See the
          * <CODE>showSplash(Component, int, int)</CODE> method description for
          * more details. 
          * @param  c  the splash screen contents
          * @return  the window object
          * @see  #showSplash(Component, int, int)
          * @see  #hideSplash()
         public JWindow showSplash(Component c) {
              return showSplash(c, -1, -1);
          * Displays a new <CODE>JWindow</CODE> as a splash screen using the
          * specified component as the content.  The component should have all
          * the content it needs to display, like borders, images, text, etc. 
          * The splash screen is centered on monitor.  If width and height are
          * <CODE><= 0</CODE>, the default size of the component will be used
          * to size the splash screen. 
          * <P>
          * The window object is returned to allow the application to manipulate
          * it, (such as move it or resize it, etc.).  However, <B>do not</B>
          * dispose the window directly.  Instead, use <CODE>hideSplash()</CODE>
          * to allow internal cleanup. 
          * <P>
          * If the component is <CODE>null</CODE>, a default component with the
          * frame title and icon will be created. 
          * <P>
          * The splash screen window will be passed the same
          * <CODE>GraphicsConfiguration</CODE> as this frame uses. 
          * @param  c  the splash screen contents
          * @param  w  the splash screen width
          * @param  h  the splash screen height
          * @return  the window object
          * @see  #showSplash(Component)
          * @see  #hideSplash()
         public JWindow showSplash(Component c, int w, int h) {
              // if a splash window was already created...
              if(splash != null) {
                   // if it's showing, leave it; else null it
                   if(splash.isShowing()) {
                        return splash;
                   } else {
                        splash = null;
              // if the component is null, then create a generic splash screen
              // based on the frame title and icon
              if(c == null) {
                   JPanel p = new JPanel();
                   p.setBorder(BorderFactory.createCompoundBorder(
                        BorderFactory.createRaisedBevelBorder(),
                        BorderFactory.createEmptyBorder(10, 10, 10, 10)
                   JLabel l = new JLabel("Loading application...");
                   if(getTitle() != null) {
                        l.setText("Loading " + getTitle() + "...");
                   if(getIconImage() != null) {
                        l.setIcon(new ImageIcon(getIconImage()));
                   p.add(l);
                   c = p;
              splash = new JWindow(this, getGraphicsConfiguration());
              splash.getContentPane().add(c);
              splash.pack();
              // set the splash screen size
              if(w > 0 && h > 0) {
                   splash.setSize(w, h);
              } else {
                   splash.setSize(c.getPreferredSize().width, c.getPreferredSize().height);
              centerComponent(splash);
              splash.show();
              return splash;
          * Disposes the splash window. 
          * @see  #showSplash(Component, int, int)
          * @see  #showSplash(Component)
         public void hideSplash() {
              if(splash != null) {
                   splash.dispose();
                   splash = null;
          * Runs an initializer <CODE>Runnable</CODE> object in a new thread. 
          * The initializer object should handle application initialization
          * steps.  A typical use would be:
          * <OL>
          *   <LI>Create the frame.
          *   <LI>Create the splash screen component.
          *   <LI>Call <CODE>showSplash()</CODE> to display splash screen.
          *   <LI>Run the initializer, in which: 
          *   <UL>
          *     <LI>Build the UI contents of the frame.
          *     <LI>Perform other initialization (load settings, data, etc.).
          *     <LI>Pack and show the frame.
          *     <LI>Call <CODE>hideSplash()</CODE>.
          *   </UL>
          * </OL>
          * <P>
          * <B>NOTE:</B>  Since this will be done in a new thread that is
          * external to the event thread, any updates to the splash screen that
          * might be done should be triggered through with
          * <CODE>SwingUtilities.invokeAndWait(Runnable)</CODE>. 
          * @param  r  the <CODE>Runnable</CODE> initializer
         public void runInitializer(Runnable r) {
              Thread t = new Thread(r);
              t.start();
          * Shows the frame centered on the screen. 
         public void showCentered() {
              centerComponent(this);
              this.show();
          * Checks the busy state.
          * @return  <CODE>true</CODE> if the frame is disabled;
          *          <CODE>false</CODE> if the frame is enabled
          * @see  #setBusy(boolean)
         public boolean isBusy() {
              return this.busy;
          * Sets the busy state.  When busy, the glasspane is shown which will
          * consume all mouse and keyboard events, and a wait cursor is
          * set for the frame. 
          * @param  busy  if <CODE>true</CODE>, disables frame;
          *               if <CODE>false</CODE>, enables frame
          * @see  #getBusy()
         public void setBusy(boolean busy) {
              // only set if changing
              if(this.busy != busy) {
                   this.busy = busy;
                   // If busy, keep current glass pane to put back when not
                   // busy.  This is done in case the application is using
                   // it's own glass pane for something special. 
                   if(busy) {
                        defaultGlassPane = getGlassPane();
                        setGlassPane(glassPane);
                   } else {
                        setGlassPane(defaultGlassPane);
                        defaultGlassPane = null;
                   glassPane.setVisible(busy);
                   glassPane.setCursor(busy ?
                        Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) :
                        Cursor.getDefaultCursor()
                   setCursor(glassPane.getCursor());
          * Handle key typed events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  ke  the key event
         public void keyTyped(KeyEvent ke) {
              ke.consume();
          * Handle key released events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  ke  the key event
         public void keyReleased(KeyEvent ke) {
              ke.consume();
          * Handle key pressed events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  ke  the key event
         public void keyPressed(KeyEvent ke) {
              ke.consume();
          * Handle mouse clicked events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  me  the mouse event
         public void mouseClicked(MouseEvent me) {
              me.consume();
          * Handle mouse entered events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  me  the mouse event
         public void mouseEntered(MouseEvent me) {
              me.consume();
          * Handle mouse exited events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  me  the mouse event
         public void mouseExited(MouseEvent me) {
              me.consume();
          * Handle mouse pressed events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  me  the mouse event
         public void mousePressed(MouseEvent me) {
              me.consume();
          * Handle mouse released events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  me  the mouse event
         public void mouseReleased(MouseEvent me) {
              me.consume();
          * Centers the component <CODE>c</CODE> on the screen. 
          * @param  c  the component to center
          * @see  #centerComponent(Component, Component)
         public static void centerComponent(Component c) {
              centerComponent(c, null);
          * Centers the component <CODE>c</CODE> on component <CODE>p</CODE>. 
          * If <CODE>p</CODE> is null, the component <CODE>c</CODE> will be
          * centered on the screen. 
          * @param  c  the component to center
          * @param  p  the parent component to center on or null for screen
          * @see  #centerComponent(Component)
         public static void centerComponent(Component c, Component p) {
              if(c != null) {
                   Dimension d = (p != null ? p.getSize() :
                        Toolkit.getDefaultToolkit().getScreenSize()
                   c.setLocation(
                        Math.max(0, (d.getSize().width/2)  - (c.getSize().width/2)),
                        Math.max(0, (d.getSize().height/2) - (c.getSize().height/2))
          * Main method.  Used for testing.
          * @param  args  the arguments
         public static void main(String[] args) {
              final AppFrame f = new AppFrame("Test Application",
                   new ImageIcon("center.gif"));
              f.showSplash(null);
              f.runInitializer(new Runnable() {
                   public void run() {
                        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        f.getContentPane().add(new JButton("this is a frame"));
                        f.pack();
                        f.setSize(300, 400);
                        try {
                             Thread.currentThread().sleep(3000);
                        } catch(Exception e) {}
                        f.showCentered();
                        f.setBusy(true);
                        try {
                             Thread.currentThread().sleep(100);
                        } catch(Exception e) {}
                        f.hideSplash();
                        try {
                             Thread.currentThread().sleep(3000);
                        } catch(Exception e) {}
                        f.setBusy(false);
    "Useful Code of the Day" is supplied by the person who posted this message. This code is not guaranteed by any warranty whatsoever. The code is free to use and modify as you see fit. The code was tested and worked for the author. If anyone else has some useful code, feel free to post it under this heading.

    Hi
    Thanks fo this piece of code. This one really help me
    Deepa

  • Custom splash screen for app under JWS 1.2 from 1.4.1 beta?

    Has anyone gotten a custom app's splash screen to come up instead of the damn Sun Java Web Start splash screen to come up when the app starts from a desktop icon or if you launch it from JWS?
    I added it to my jnlp file as specified in the docs, but it just doesn't come up :-(
    <description kind="tooltip">TransMedia 2</description>
    <icon kind="default" href="transmedia.gif" />
    <icon kind="selected" href="transmedia.gif" />
    <icon kind="disabled" href="transmedia.gif" />
    <icon kind="rollover" href="transmedia.gif" />
    <icon kind="splash" href="transmediasplash.gif" />
    </information>

    Hello,
    I read your postings here and I did what you proposed.
    Nevertheless the splash screen doesn't show up.
    I'm using Java 1.4.1, Web Start 1.2; the jnlp file
    looks like that:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp codebase="http://venus/example-client/" href="example.jnlp">
    <information>
    <title>Example</title>
    <vendor>My Company/vendor>
    <description>JBoss Client</description>
    <icon href="splashscreen.jpg" kind="splash" />
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.4+"/>
    <jar href="example-client.jar" main="true"/>
    <jar href="jbosssx-client.jar"/>
    <jar href="concurrent.jar"/>
    <jar href="jboss-client.jar"/>
    <jar href="jboss-common-client.jar"/>
    <jar href="jboss-j2ee.jar"/>
    <jar href="jnp-client.jar"/>
    <jar href="log4j.jar"/>
    <jar href="datepicker.jar"/>
    <jar href="jcommon-0.7.1.jar"/>
    <jar href="jfreechart-0.9.4.jar"/>
    <jar href="xercesImpl.jar"/>
    <jar href="xml-apis.jar"/>
    <jar href="xalan.jar"/>
    <property name="java.security.auth.login.config" value="http://venus/example-client/auth.conf"/>
    </resources>
    <application-desc main-class="com.mycompany.ui.Example"/>
    </jnlp>
    any idea why webstart doesn't use the custom "splashscreen.jpg"?
    a properly splashXXXXX.jpg has been created in .javaws/cache/splashes, as well as an entry in splash.xml.
    thanx for help,
    michael

  • Custom splash screen only shows up when command line is used...

    Hi,
    Everything in my Java web start application works perfectly but, the custom splash screen only shows up when command line is used ("C:\Program Files (x86)\Java\jre7\bin>javaws -verbose http://www.xxx.eu/AcSentVivresCrus/AcSentJnlp/AcSent.jnlp"), if I use the shortcut on the desktop or in the start menu, the Java 7 splash screen shows up (tested under Windows Vista and Seven). Does someone have any clues?
    Thanks...
    My jnlp file :
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="6.0+" href="AcSent.jnlp">
      <information>
        <title>AcSent : Commande de repas</title>
        <description>AcSent - Commande de repas</description>
        <vendor>AcSent</vendor>
        <homepage href="http://www.xxx.eu" />
        <icon href="acSentIconBiseau.png" />
        <icon href="splashAcSentRC.png" kind="splash" />
        <shortcut online="true">
          <desktop />
          <menu submenu="AcSent" />
        </shortcut>
      </information>
      <security>
        <all-permissions />
      </security>
      <resources>
        <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" max-heap-size="128m" />
        <jar href="AcSentJnlpProgressIndicator.jar" download="progress" />
        <jar href="AcSentJnlp.jar" main="true" version="1.0" />
        <property name="jnlp.packEnabled" value="true" />
        <property name="jnlp.versionEnabled" value="true" />
      </resources>
      <application-desc name="AcSent" main-class="eu.acsent.jnlp.AcSentApplication"
           progress-class="eu.acsent.jnlp.progressindicator.CustomProgress"> 
      </application-desc>
    </jnlp>

    Hi again,
    I made some researches :
    - The link in the generated shorcuts ("C:\Windows\SysWOW64\javaws.exe -localfile -J-Djnlp.application.href=http://www.xxx.eu/AcSentVivresCrus/AcSentJnlp/AcSent.jnlp "C:\Users\Arnaud\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\46\69c1e9ee-1f252d1a") is not the same as the one I use in the command line ("C:\Program Files (x86)\Java\jre7\bin>javaws -verbose http://www.xxx.eu/AcSentVivresCrus/AcSentJnlp/AcSent.jnlp"). Is there a way in the the JNLP file to tell how to generate shortcuts (not the icon, etc., but command line options)?
    - This sample (https://blogs.oracle.com/thejavatutorials/entry/changing_the_java_web_start) displays the splash screen when I click on the the generated shortcuts (I use Windows 7). I have copied the ButtonDemo jar file and the JNLP file on my IIS web server (Windows 2008 Server), this time the splash screen does not show up when I click the generated shortcuts but always shows up when I use the command line. Can someone tell me if it is a trouble with IIS ?
    Thanks again...

  • Custom splash screen not appearing in the Dynamic created jnlp()

    Hi,
    I am not able to show my custom splash screen while starting the webstart application, instead getting the "sun webstart logo". I am dynamically generating the jnlp file using jsp (struts application). Application is working perfectly except custom splash screen. Below is my jsp which will generate the jnlp on fly. The test.gif file is in place.
    <% response.setContentType("application/x-java-jnlp-file");
      response.setHeader( "Pragma", "no-cache");
      response.setDateHeader( "Expires", 0 );%>
    <%@ page import="java.io.*" %> 
    <%String baseURL = WebUtil.webUrlParser(request.getRequestURL().toString(),request.getContextPath(),request.getServerPort());%>
    <jnlp      spec="1.0+" codebase="<%=baseURL%>/cs_jnlp">
    <information>
        <title>Launching JNLP</title>
        <vendor>Satyasai</vendor>
        <icon href="/images/test1.jpg"/>
        <homepage href="docs/help.html"/>
       <description>test</description>
            <icon kind="splash" href="images/test.gif" />
       </information>
          <security>
            <all-permissions/>
         </security>
         <resources>
       <j2se version="1.6+"/>
       <jar href="<%=baseURL%>/cs_jnlp/AppLaunch.jar"/>
      </resources>
           <application-desc main-class="Launch" >
           <%
           int roleId = (Integer)session.getAttribute(Constant.USER_TYPE);
           String sessionID=(String)request.getAttribute("SELECTION_SESSION_ID");
           String action=(String)request.getAttribute("action");
           String userID = (String)session.getAttribute(Constant.LOGIN_ID);       
           String sessionType=(String)request.getAttribute("sessionType");        
           %>
           <argument><%=sessionID%></argument>
           <argument><%=action%></argument>
           <argument><%=userID%></argument>
           <argument><%=sessionType%></argument> 
    </application-desc>
    </jnlp>If I use normal servlet - jsp using RequestDispatcher to forward request to a jsp which on fly creates jnlp, it shows the my custom splash screen. I am not very sure where is the difference. If I look at both generated jnlps they are almost one and the same. Can any one throw some insight on this.
    Thanks & Regards,
    Satyasai

    Hi Andrew,
    Thanks for your response.
    1. I have launched it number of times but no luck.
    2. I have written a jsp (using servlet + jsp no struts frame work) which will create jnlp on fly, which is showing my custom splash screen. If you refer in the initial post, it is not working with struts kind of framework. See the below jsp which shows custom splash screen. It worked without href.
    3. All jnlps are well formed and perfectly working in my development environment. For security purposes I have not shown some of the texts and logos.
    <% response.setContentType("application/x-java-jnlp-file");
      response.setHeader( "Pragma", "no-cache");
      response.setDateHeader( "Expires", 0 );%>
    <%@page import="java.util.ArrayList" %>
    <%
    String client = (String)request.getAttribute("clientLocation");
    String fileNames = (String)request.getAttribute("filenames");
    String url= (String)request.getAttribute("serverFilesLocation");
    String baseURL = "http://"+request.getLocalAddr()+":"+request.getServerPort()+request.getContextPath();
    %>
    <jnlp spec="1.0+" codebase="<%=baseURL%>/sw_jnlp"> 
      <information>
        <title>Softwares Download</title>
        <vendor>test</vendor>
        <icon href="/images/test1.jpg"/>
        <homepage href="docs/help.html"/>
       <description>Software Downloads </description>
            <icon kind="splash" href="images/logo_small.gif" />
       </information>
       <update check="timeout" policy="always"/>
          <security>
          <all-permissions/>
      </security>
      <resources>
        <j2se version="1.6+"/>        
        <jar href="mod.jar"/>  
      </resources> 
      <application-desc main-class="InstallSW">
      <argument><%=client%></argument>
      <argument><%=fileNames%></argument>
      <argument><%=url%></argument>
      </application-desc>
    </jnlp>Thanks & Regards,
    Satyasai

Maybe you are looking for

  • Music I have downloaded through iTunes on my iPhone 5 does not show in my "music" app

    Would anybody know what I can do? I've downloaded songs from iTunes on my iPhone 5, but hey are nowhere to be found. I also have an iPhone 4 and he music settings on that phone seem to be he same and the same purchased songs ARE showing there and on

  • Import javafx. not working.

    I installles jdk7u11.I added path and classpath for jdk. But cant compile a basic java file that imports javafx package . Edited by: 982901 on Jan 19, 2013 5:29 AM

  • Reason for rejection during "Tech Response & Awards"

    Hi, SRM 7.0 PPS: We have seen that, In 2 envelope RFx Response, when a bid is accepted/rejected  duing the tech bid response and awards, the system sends a mail to him. Here, if the bid was rejected, we want to include the "Reason for Rejection", in

  • How to find out whether ipv6 is installed or not

    Hello. I need to determine (in Java 1.5) whether ipv6 is installed on a system (Windows) or not. Any ideas how could I do that? Is it possible at all? Thanks in advance.

  • Cannot click one time back to go back to the main screen

    Hi all, i have encountered a problem whereby i have this internal table tied to an alv screen. i have already define my PF status for my back button but it doesnt seem to be working fine for me. as i click on the back button only the alv is gone, aft