Problem in displaying splash screen..

Hi..
First of all my apology to repost the question as i was asked to post it here for the answer.I've developed a desktop application which has a splash screen.I'm using netbeans 6.0.Now, i am able to view the splash screen if i 'build' and 'run' the application in the IDE.But when i run the jar file i am not able to see the splash screen.
This is how i've put the splash screen for my application.In project->properties->run->in VM options : splash.gif. Please help to display the splash screen when i run just the jar file.
Thank you

I don't understand what the way you're doing. It's a Netbeans option??
Currently I'm developing a Swing app and I have a splash window. The way I've done it is creating a sublcass of JWindow, adding a panel, a JLabel and setting an icon.
Like this:
public class InitSplash extends JWindow {
     public InitSplash(Frame owner) throws HeadlessException {
          super(owner);
          initGUI();
          Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          Dimension labelSize = jLabel.getPreferredSize();
          setLocation(screenSize.width / 2 - (labelSize.width / 2),
                    screenSize.height / 2 - (labelSize.height / 2));
     private void initGUI() {
          try {
                    this.setPreferredSize(new java.awt.Dimension(110, 150));
                    this.setLocationByPlatform(true);
                    jPanel1 = new JPanel();
                    getContentPane().add(jPanel1, BorderLayout.CENTER);
                    jPanel1.setBackground(new java.awt.Color(255,255,255));
                    jPanel1.setBorder(new LineBorder(new java.awt.Color(0,0,0), 2, false));
                         jLabel = new JLabel();
                         jPanel1.add(jLabel);
                         jLabel
                                   .setIcon(new ImageIcon(
                                             getClass()
                                                       .getClassLoader()
                                                       .getResource(
                                                                 "com/ttt/common/gui/graphics/logo-transparente.gif")));
                         msgLabel = new JLabel();
                         jPanel1.add(msgLabel);
                         msgLabel.setText("Loading...");
                         msgLabel.setFont(new java.awt.Font("Tahoma",1,12));
                         msgLabel.setPreferredSize(new java.awt.Dimension(102, 25));
                         msgLabel.setHorizontalAlignment(SwingConstants.CENTER);
               pack();
          } catch (Exception e) {
               e.printStackTrace();
     }Is this what you are trying?

Similar Messages

  • To display splash screen for certian period of time using threads

    i want to write a program to display splash screen for certian period of time using threads. could some one help me

    If you just want a splash screen: [http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/splashscreen/|http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/splashscreen/]
    If you want to learn threads: [http://java.sun.com/docs/books/tutorial/essential/concurrency/|http://java.sun.com/docs/books/tutorial/essential/concurrency/]

  • Hi guys need Help with Displaying Splash Screen?!!?

    Hi Guys.
    Sorry for the last incomplete post my mistake!
    I need help displaying a splash screen as an advertisment or something before i have my main application run.
    Here is the code i wrote (it works as if it were a seperate application)
    package MajourProject;
    import java.awt.AWTException;
    import java.awt.Dimension;
    import java.awt.Robot;
    import java.awt.Toolkit;
    import javax.swing.ImageIcon;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JProgressBar;
    import javax.swing.JScrollPane;
    import javax.swing.JWindow;
    * @author Matt
    public class SplashScreen extends JWindow
        public SplashScreen()
            int UpTime = 20000;
            Start(UpTime);
        public void Start(int UpTime)
            ImageIcon ii = new ImageIcon("src/1.jpg");
              JScrollPane jsp = new JScrollPane(new JLabel(ii));
                    JProgressBar Bar = new JProgressBar();
              getContentPane().add(jsp);
              setSize(853,303);
              centerScreen();
              setVisible(true);
                   try
                                Thread.sleep(20000);
                               dispose();
                   catch(Exception IE)
            private void centerScreen()
                    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
                    int x = (int) ((d.getWidth() - getWidth()) / 2);
              int y = (int) ((d.getHeight() - getHeight()) / 2);
              setLocation(x, (y-100));
           public static void main(String [] args)
                 new SplashScreen();
    }but i now have a problem as i already have a main application done as i wrote this seperately. I now need to combine the two together. So what i did was in my Main Application wrote:
    Splash_Screen SS = new Splash_Screen();it then runs my Splash Screen class which i re-wrote to look as such:
    package MajourProject;
    import java.awt.AWTException;
    import java.awt.Dimension;
    import java.awt.Robot;
    import java.awt.Toolkit;
    import javax.swing.ImageIcon;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JProgressBar;
    import javax.swing.JScrollPane;
    import javax.swing.JWindow;
    * @author Matt
    public class SplashScreen extends JWindow
        public SplashScreen()
            int time = 15000;
            Start(time);
        public void Start(int UpTime)
            ImageIcon ii = new ImageIcon("src/1.jpg");
              JScrollPane jsp = new JScrollPane(new JLabel(ii));
                    JProgressBar Bar = new JProgressBar();
              getContentPane().add(jsp);
              setSize(853,303);
              centerScreen();
              setVisible(true);
                   try
                                Thread.sleep(20000);
                                dispose();
                   catch(Exception IE)
            private void centerScreen()
                    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
                    int x = (int) ((d.getWidth() - getWidth()) / 2);
              int y = (int) ((d.getHeight() - getHeight()) / 2);
              setLocation(x, (y-100));
    }it obviously runs the default constructor which then runs the other methods in the class but it doesn't seem to show can anybody help me to find out whats wrong? It seems to be there just before the main application launches but only for a split second. And when i am waiting while the thread is sleeping the area i have defined the Content pane for he cursor goes to the loading icon! I don't know if this makes any sence to you but if you can help me it would be most apreciated.
    Thanks.

    SpearOne wrote:
    Hi Encephalopathic
    why would it work if i put it in it's own application surely it wouldn't be caused by this thread.sleep?? everything after it is in fact put to sleep. In its "own" application, nothing happens after it is displayed.
    if it is the problem then could you please give me some code to add quickly to test??
    import java.awt.Dimension;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JProgressBar;
    import javax.swing.JScrollPane;
    import javax.swing.JWindow;
    import javax.swing.Timer;
    public class SplashScreen extends JWindow
      private static final String IMAGE_PATH = "src/1.jpg";
      private static final int UP_TIME = 15000;
      public SplashScreen()
        Start();
      public void Start()
        ImageIcon ii = new ImageIcon(IMAGE_PATH);
        JScrollPane jsp = new JScrollPane(new JLabel(ii));
        //JProgressBar Bar = new JProgressBar();
        getContentPane().add(jsp);
        setSize(853, 303);
        centerScreen();
      private void centerScreen()
        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
        int x = (int) ((d.getWidth() - getWidth()) / 2);
        int y = (int) ((d.getHeight() - getHeight()) / 2);
        setLocation(x, (y - 100));
      public static void main(String[] args)
        final JFrame frame = new JFrame("Main Frame");
        frame.setPreferredSize(new Dimension(300, 200));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        final SplashScreen splash = new SplashScreen();
        splash.setVisible(true);
        Timer swingTimer = new Timer(UP_TIME, new ActionListener()
          public void actionPerformed(ActionEvent e)
            splash.dispose();
            frame.setVisible(true);
        swingTimer.setRepeats(false);
        swingTimer.start();
    }

  • Web start won't display splash screen

    Hi, I am using the following .jnlp file.. The problem I am having is that web start will not display the splash screen specified below. It displays the icon fine, but not the splash screen. I cannot find an answer, can anyone help?
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp spec="1.0+"
    codebase="https://mywebserver/program"
    href="https://mywebserver/progem/start.jnlp">
    <information>
    <title>My Title</title>
    <vendor>My company</vendor>
    <description></description>
    <offline-disallowed/>
    <icon href="ban1.jpg" kind="splash" />
    <icon href="icon.jpg"/>
    </information>
    <resources>
    <j2se version="1.1+"/>
    <jar href="start.jar"/>
    </resources>
    <applet-desc
    main-class="myclass"
    documentbase="start..html"
    name="Program Name"
    width="180"
    height="100">
    </applet-desc>
    </jnlp>

    I can see no reason why this wouldn't work. Can you try looking at the splash.xml file in the "splash" directory in the cache ?
    the file should contain an entry for your program, pointing to your splash file.
    /Andy

  • Problem with the splash screen

    Hi,
    since a week the splash screen (the "about box" with version of ps etc.) of photoshop cs5 extended is at the wrong position. Normally this one is in the middle of my screen, but now it is on the top. The splash screens of Indesign and Illustrator (and the other ones) are at the correct position.
    I started photoshop with the combination "Ctrl + Alt + Shift" to reset all settings of it. Nothing happens, still the same.
    It's not a critical problem, because photoshop works without an error, but it doesn't look nice.
    Thank you for every idea or help.
    Greetings from Germany
    RazooN

    For me the Photoshop splash screen is centered on my primary monitor (of two).
    "Spanning" refers to making a single virtual display out of multiple monitors.  Some games and specialized applications need this to put their displays on multiple screens (Photoshop does not).  Since you have only one monitor, my question is not pertinent.
    I can only suggest, since what you're reporting almost has to be due to a failure in the reporting of the desktop metrics, that perhaps a video driver update (from the web site of the maker of your video card) might help.
    A shot in the dark:  You don't use a desktop "reskinning" application called StarDock WindowBlinds do you?
    -Noel

  • Display splash screen while downloading applet jar file

    I've tried to search the forums, but most results I get are how to display a splash screen while the classes are loading. Unfortunately, the classes do not begin loading until after the jar file has been downloaded. How does one go about showing as splash screen as the jar file containing the classes is downloaded?
    Thanks for the help!

    "Java 5 provides a capability in this area"- Unfortunately, due to circumstances out of our control we are stuck on java 1.4.x.
    "How you do that is your problem."- I'm so glad I can count on the helpful java community. Thanks.
    Since it appears that "warnerja" is discusted by my question (mabye had a bad day) and is leaving me out in the cold, does anyone have any ideas on how I can implement her/his suggestion. I can break my jar file into multiple seperate jars and as each one loads I can update a progress bar. Unfortunately, I do not know where to begin with this code wise nor do I know if this is the best solution to this problem. I would think this to be a common problem.
    Thanks for your help!

  • Problem in displaying selection screen of a abap-hr report

    Hi,
    I have developed a abap-hr report in ver..6.2.I have used logical data base PNP for it.It was working fine.
    But when i migrate it into ver.4.6, I can see no selection screen for the report.
    How to get the selection-screen?
    Please help me through.
    Thanks in advance,
    Raj.
    Edited by: raj b on Feb 20, 2008 8:00 AM

    Hi Raj,
    Please check whether you have assigned any report category for the PNP selection screen in the version 6.2.
    The report category might not exist in the 4.6 version and that might be the reason the selection screen is not appearing.
    Cheers,
    Aditya

  • 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

  • J2ME splash screen using alerts

    Hi everyone,
    I have used alerts before with no problem, but I am having probelms using them to create a welcome splash screen. The code I have used is below:
    private void showSplashScreen(Display d)
         Image logo = null;
         try
         logo = Image.createImage("/images/logo.png");
         catch( IOException e )
                   System.out.println(e);
         Alert splash = new Alert( "Advanced Predictive Text", "David Fowler", logo, null);
         splash.setTimeout(3000);
         d.setCurrent(splash, tb); // tb is a global variable
         System.out.println("Displayed splash screen");
    The method is called on startup. The toolkit displays "Displayed splash screen", but nothing is shown on the emulator. If it's running the code why isn't the alert appearing? The textbox (tb) appears no probs!
    Three days prior to my final year demo...please help!!!
    Many thanks in advance,
    David Fowler

    try this...
    private void showSplashScreen()
         Image logo = null;
         try
              logo = Image.createImage("/images/logo.png");
         catch( IOException e )
              System.out.println(e);
         Alert splash = new Alert("Advanced Predictive Text", "David Fowler", logo, null);
         splash.setTimeout(3000);
         Display.getDisplay(this).setCurrent(splash);
         System.out.println("Displayed splash screen");
    }

  • Splash Screens

    I found good example for displaying splash screen in swing application.
    http://java-junction.blogspot.com/

    [http://forum.java.sun.com/thread.jspa?threadID=5306996]

  • Cerate splash screen

    good to all,
    someone has some sample code of how to create a splash screen?
    Greetings!

    Read the section "How to Use the Command-Line Argument to Display a Splash Screen" and "How to Use a JAR File to Display Splash Screen" from the link DB gave you.

  • Problem with displaying a splash screen twice

    I have a splash screen that displays while I am reading data from the recordstore, I use the same sceen when I am writing data back to the record store when the application exits.
    The problem I am having is that the screen never appears the second time, I have tried to set it to null and then instantiate it again but it still does not appear. Can someone please give me some adivse as to why this might be happening. I am pretty sure it is some kind of race condition with the threads but I just cant seem to solve it. I am placing snipits of code below.
    public class NetTools extends MIDlet implements CommandListener
    public void startApp()
    isPaused = false;
    display = Display.getDisplay(this);
    splash = new Splash();
    splash.start();
    settings = new Settings(this);
    settings.start();
    display.setCurrent(splash);
    splash.StartTimer();
    splash.setMsg("Loading Settings...");
    settings.Load();
    splash.setMsg("Loading Main App...");
    splash.Dismiss();
    showMainScreen();
    splash = null;
    public void destroyApp(boolean unconditional)
    display = Display.getDisplay(this);
    splash = new Splash();
    splash.start();
    display.setCurrent(splash);
    splash.setMsg("Saving Settings...");
    //splash.Join();
    //splash.StartTimer();
    settings.Save();
    //splash.Dismiss();
    settings = null;
    splash = null;
    public class Settings implements Runnable
    public void Load()
    try
    thread.yield();
    public void Save()
    try
    thread.yield();
    public class Splash extends Canvas implements Runnable
    public void StartTimer()
    start_time = System.currentTimeMillis();
    repaint();
    serviceRepaints();
    public void Dismiss()
    while ((start_time+WAIT_TIME)>System.currentTimeMillis())
    repaint();
    I cannot seem to figure out how to make the thread for the splash overtake the UI thread in the destroyApp(), does anybody have any ideas.
    Sunny

    A grey box with the splash screen size is displayed.would indicate you have your "application which takes sometime to load" in the
    EDT, which will prevent painting until loading finishes
    use a separate thread to load the data
    http://java.sun.com/docs/books/tutorial/essential/threads/
    http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html
    http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html

  • Display dead until splash screen

    Kind of an odd problem. For a while the display would not work at all.
    Zapped PRAM, Reset, NVRAM, removed ram upgrade and Airport card, no change.
    I finally try and boot from the recovery CD's and amazingly, it works again.
    Now, it works once it gets inside the GUI. But, from the startup chime to the "Starting Mac OSX" screen, it's dead. I dont get any video at all until I get that blue splash screen. No single user, no verbose boot, no grey boot screen with the apple.
    I can boot into OF and Single User modes, and they work, I just get no video at all.
    If anyone has an idea of what I can do about it, I'd appreciate a pointer, I'm pretty stuck right now.
    iBook G4, 1.2Ghz   Mac OS X (10.4.5)   1.25GB Ram, 30 gig HD

    Hi Lwood,
    Welcome to Apple Discussions
    Have you tried reseting the PMU (Knowledge Base Document #14449, which covers Resetting Powerbook and iBook Power Management Unit (PMU)). You may want to look at...
    Knowledge Base Document #300552 on My computer won't turn on (Display troubleshooting
    Knowledge Base Document #106214 on Troubleshooting Startup Issues
    Jon
    PS Bring it to your local Apple Store/Reseller is not a bad idea at all. It is hard to troubleshoot exact problems without out being able to interact with the computer personally.
    Mac Mini 1.42Ghz, iPod (All), Airport (Graphite & Express), G4 1.33Ghz iBook, G4 iMac 1Ghz, G3 500Mhz, iBook iMac 233Mhz, eMate, Power Mac 5400 LC, PowerBook 540c, Macintosh 128K, Apple //e, Apple //, and some more...  Mac OS X (10.4.5) Moto Razr, iLife '06, SmartDisk 160Gb, Apple BT Mouse, Sight..

  • How to display different Splash Screen depending on the Locale?

    Hi,
    I have a splash screen which is working fine.
    I want to display different spalsh screen depending on the locale the user has.
    Is this possible.
    I can display different Title,Description and the text of the short-cut icon on desktop and startup Menu based on the locale by mentioning it in the JNLP and altering my browser settings. I am not able to use the icon and splash screen corresponding to the specified locale. How to do this?
    EX:
    <information>
    <title> In english</title>
    <description> In english</description>
    <shortcut online="true">
    <!-- create desktop shortcut -->
    <desktop/>
    <menu submenu="My Project in English language"/>
    </shortcut>
    *<icon kind="shortcut" href="images/icon_english.gif"/>
    <icon kind="splash" href="images/splash_english.jpg"/>*
    <!-- locale="nl-NL" specifies dutch -->
    </information>
    <information locale="nl-NL">
    <title> In Dutch</title>
    <description>In Dutch</description>
    <shortcut online="true">
    <!-- create desktop shortcut -->
    <desktop/>
    <menu submenu="My Project in Dutch language"/>
    </shortcut>
    *<icon kind="shortcut" href="images/icon_dutch.gif"/>
    <icon kind="splash" href="images/splash_dutch.jpg"/>*
    </information>
    *Now here i am not getting the splash_dutch screen for the locale "nl-NL"(Dutch) and i am getting splash_english screen.
    Can we acheive this?*

    Hi anjali...
    I have problem with splash screen..
    here is my jnlp file
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://localhost:8080/MyProject">
         <information>
              <title>MyProject1.0</title>
              <vendor>none</vendor>
              <description>Application Launcher For MyProject1.0</description>
              <description kind="short"></description>
              <offline-allowed />
              <icon kind="splash" href="images/Splash_MyProject.jpg" width="560" height="300"/>
         </information>
         <resources>
              <jar href="SwingApplication/mysql-connector-java-5.0.6-bin.jar" />
              <jar href="SwingApplication/MyProject1.0.jar" main="true"/>
              <jar href="SwingApplication/liquidlnf.jar" />
              <j2se version="1.6+" java-vm-args="-Xms32M -Xmx256M " />
         </resources>
         <security>
              <all-permissions/>
         </security>
         <application-desc main-class="com.mobius.ui.MainWindow">
              <argument>production%0%3#com.mysql.jdbc.Driver#MyProject4%jdbc:mysql://10.100.1.89:3306/MyProject4%MyProject%info123#MyProject2%jdbc:mysql://10.100.1.89:3306/MyProject2%MyProject%info123</argument>
         </application-desc>
    </jnlp>my post is in
    http://forum.java.sun.com/thread.jspa?threadID=5298381
    http://forum.java.sun.com/thread.jspa?threadID=5298466
    I am in big problem Help me...
    Edited by: arunnprakash on May 22, 2008 1:28 PM
    Edited by: arunnprakash on May 22, 2008 1:28 PM

  • Displaying a Splash Screen

    Hi:
    I have an application which takes sometime to load and decided to display a splash screen. The splash screen is a simple JFrame with a JPanel within. The splash screen is displaying but it�s not being painted at all. A grey box with the splash screen size is displayed.
    Following is the code from where I�m calling both the splash screen and the application.
        private static void startApplication() {
            SplashScreen splashScreen = new SplashScreen();
            System.out.println("Loading...");
            splashScreen.setUndecorated(true);
            splashScreen.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            splashScreen.pack();
            splashScreen.setLocationRelativeTo(null);
            splashScreen.setVisible(true);
            try {
                Application application = new Application();
                splashScreen.setCompleted(0.2);
                System.out.println("Loading Database...");
                application.initDatabase();
                System.out.println("Loading of Database Complete...");
                splashScreen.setCompleted(0.5);
                application.initActions();
                splashScreen.setCompleted(0.6);
                application.initToolBar();
                splashScreen.setCompleted(0.7);
                application.initMenuBar();
                splashScreen.setCompleted(0.8);
                application.initComponents();
                splashScreen.setCompleted(0.9);
                application.setDefaultCloseOperation(Application.DISPOSE_ON_CLOSE);
                application.setTitle("Password Keeper");
                application.setUndecorated(false);
                application.pack();
                application.setLocationRelativeTo(null);
                splashScreen.setCompleted(1);
                application.setVisible(true);
            }catch(ClassNotFoundException e) {
                System.err.println("Failed to load the required classes.");
                JOptionPane.showMessageDialog(splashScreen, "Failed to load the required classes.", "Loading Application", JOptionPane.ERROR_MESSAGE);
            }catch(SQLException e){
                System.err.println("Failed to load the required classes.");
                JOptionPane.showMessageDialog(splashScreen, "An error occured while connecting with the database.", "Loading Application", JOptionPane.ERROR_MESSAGE);
            System.out.println("Application Started...");
            splashScreen.setVisible(false);
            splashScreen.dispose();
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    startApplication();
        }The problem started to show up when the application was included. This works fine when the splash screen is displayed by itself.
    Albert Attard

    A grey box with the splash screen size is displayed.would indicate you have your "application which takes sometime to load" in the
    EDT, which will prevent painting until loading finishes
    use a separate thread to load the data
    http://java.sun.com/docs/books/tutorial/essential/threads/
    http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html
    http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html

Maybe you are looking for