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/]

Similar Messages

  • Getting increasingly frequent system shutdown with appearance of the apple splash screen for several minutes then back to logon in the middle of using a variety of APPs or just walking on Safari.

    Using an IPAD 2 running 5.0.1 is frequently shutting down in the middle of a variety of Apps and showing the Apple splash screen for several minutes. This happens occasionally at inopportune times. Once the splash screen clears it goes back to the logon screen and the App that was open is closed. Has anyone else encountered this? Is there a resolution?

    RockHunter wrote:
    This happens occasionally at inopportune times.
    I don't think that there is ever a good time for this to occur.
    What do you mean the Apple splash screen? You see the Apple logo on the screen?
    It appears as though your apps are crashing. Have you tried quitting apps and restarting? Reset the iPad?
    Quit all apps and restart. Go to the home screen first by tapping the home button. Quit/close open apps by double tapping the home button and the task bar will appear with all of you recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner to close the apps. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • Creating a splash screen for your app.

    Im trying to create a splash screen for my app but im not too sure how it's done.
    Im using the following piece of code.
    public static void main(String[] args)
              JPanel display = new JPanel();
              display.setPreferredSize(new Dimension( (300), (200) ));
              display.setBackground(Color.white);
                   // I WILL PUT AN IMAGE ICON ON A JLABEL HERE              
              display.setVisible(true);
                   // I WILL NEED A DELAY HERE
              test.instance();
    }The problem I am having is that the JPanel is not being displayed. I will also need a way to create a delay, I know that I can't just use Thread.sleep(5000); because the JPanel will require the thread to be running in order to display the panel.
    Does anyone know how I could get my JPanel to display and somehow insert a delay before test.instance();?
    Thanks.

    I made my own a few days before for a database program. It can be easily done with Threads.
    I recommend you create a new class to be used as the spalsh screen , it has to extends JFrame and implements Runnable.
    I ll give you an example. I used the spash screen to display the screen and also to laod the main GUI form so that when the spash screen dispose, the main GUI form displays instantly, making the user think that the application loads faster.
    public void run ()
            try
                 this.setVisible(true);
                 Thread.sleep(2000);
                 // sets the menu visible before disposing
                 guiMenu.setVisible(true);
                 // disposes the object and returns the resources to the OS
                 this.dispose();
            catch(InterruptedException exception)
                exception.printStackTrace();
    // this method must be implement in the class
    // that implements Runnable interface
    //MAIN
    public class Main
        public static void main(String[] args)
            Menu menu = new Menu();
            SplashScreen introScreen = new SplashScreen(menu);
            ExecutorService splashExecutor= Executors.newFixedThreadPool(1);
            splashExecutor.execute(introScreen);       
    }ExecutorService is a subinterface of Executor that declares methods for managing the threads. It also has the method execute (that provides the Executor interface) which when invoked calls the method public void run() of the argument class that must implement Runnable.
    Executors.newFixedThreadPool(1); creates a poll consisting of a 1 thread which is been used by splashExecutor to execute the Runnable.
    Hope i've been of some assistance!

  • 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?

  • Chromeless splash screen for application

    hi!
    Anyone know how to create a Chromeless splash screen for java application.Just like the startup screen for the normal application? When the java application start-up the screen will show, it's close after a few screen or user click a button.
    and is there anyway to add background image for a java application?
    Thank in advance!
    jet

    hi there, check a look at this code:
    import javax.swing.*;
    import java.awt.*;
    public class Splash implements Runnable, mainInterface{
    private String initMsg;
    public Splash(String initMsg) {
    this.initMsg = initMsg;
    public void run() {
    splashWindow.getContentPane().add(l, BorderLayout.CENTER);
    splashWindow.pack();
    splashWindow.setSize(splashWindow.getSize().width, splashWindow.getSize().height);
    splashWindow.setLocation(dim.width/2 - splashWindow.getWidth() /2,dim.height/2 -
    splashWindow.getHeight()/2);
    splashWindow.toFront();
    splashWindow.show(); }
    public JWindow getWindow()
    return splashWindow;
    }add this code to the main file
    private static void splash()
              th.start(); // I sleep to let the thread startup and display the window
                   while (splash3.getWindow() == null || !splash3.getWindow().isShowing())
                        try {
                             Thread.sleep(2000);
                        catch (InterruptedException e){}
         }hope u understand this
    asrar

  • Screen freezes randomly for short periods of time [Solved]

    I'm not sure when this started to happen, but my screen will freeze (not refresh) randomly for short periods of time (about 5 seconds). The mouse cursor still active and anything I click on will eventually catch up once the screen refreshes.
    I'm assuming this is an Xorg issue, or perhaps and Nvidia issue, but here are some details:
    KDE 4.4
    Kernel 2.6.32-ARCH 64
    Nvidia 195.36.15
    And here is my Xorg.conf:
    # nvidia-xconfig: X configuration file generated by nvidia-xconfig
    # nvidia-xconfig: version 1.0 (buildmeister@builder58) Tue Oct 20 21:25:04 PDT 2009
    Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0" 0 0
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
    InputDevice "SynapticsTouchpad" "SendCoreEvents"
    EndSection
    Section "Files"
    EndSection
    Section "Module"
    Load "glx"
    Load "synaptics"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/psaux"
    Option "Emulate3Buttons" "no"
    Option "ZAxisMapping" "4 5"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Keyboard0"
    Driver "kbd"
    EndSection
    Section "InputDevice"
    Identifier "SynapticsTouchpad"
    Driver "synaptics"
    Option "AlwaysCore" "true"
    Option "/dev/input/mice"
    Option "/dev/psaux"
    Option "VerticalEdgeScroll" "True"
    Option "HorizontalEdgeScroll" "True"
    Option "CornerCoasting" "true"
    Option "TapButton1" "1"
    Option "TapButton2" "2"
    EndSection
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    ModelName "Unknown"
    HorizSync 28.0 - 33.0
    VertRefresh 43.0 - 72.0
    Option "DPMS"
    EndSection
    Section "Device"
    Identifier "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    EndSection
    Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    Option "NoLogo" "True"
    Option "RenderAccel" "True"
    Option "TripleBuffer" "True"
    Option "BackingStore" "True"
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection
    Needless to say this is very annoying/embarrassing when I try and show people stuff, so any help would be greatly appreciated!
    Last edited by fini_fly (2010-05-21 13:47:20)

    What you can try is to add:
    option "UseEvents" "false"
    (also try "true" and see if it works for you)
    to your xorg.conf under the device section. Play with both false and true settings, UseEvents is somewhat related to the short freezes and the nvidia guys mentioned they disabled this feature a few driver releases ago (as far as i know from researching their forums). Otherwise we probably have to wait for a new driver series.
    Another tweak would be to check if you use MSI for your nvidia card:
    cat /proc/interrupts:
    22: 0 4 1106 297835 IO-APIC-fasteoi ohci_hcd:usb3
    23: 1 17 3275 890447 IO-APIC-fasteoi hda_intel
    27: 2 13 1035 342106 PCI-MSI-edge ahci
    28: 5 337 26356 7568321 PCI-MSI-edge eth0
    29: 6 92 10219 1998835 PCI-MSI-edge nvidia
    NMI: 0 0 0 0 Non-maskable interrupts
    add this to /etc/modprobe.d/options.conf: (does not work with all nvidia cards but i can confirm it works with the 200 series)
    options nvidia NVreg_EnableMSI=1
    While using MSI slightly improves performance some people reported it also shortens the occasional freezes.
    As said in the post above this is only for nvidia and it may or may not help for some gpu's.
    Best regards

  • Lightroom won't boot -I only get the splash screen for a second.

    I do have the photographers version of the Creative Cloud which included Photoshop CC 2014 and Lightroom. Everything was working just fine until I upgraded to Lightroom version 5.6. Now when I try to load LR, the slash screen shows for a second then disappears and LR does not load. This occurs on both my Mac (a Mac Pro and a iMac). I uninstalled LR and had creative cloud reinstall but still the same thing is happening  - Splash screen for a second then nothing. Again, this is happening on both Mac's. Photoshop CC 2014 I working just fine.
    Before I call Adobe, any ideas here on this issue. BTW, Creative Cloud App states LR in up to date and installed.
    Thanks
    James

    Hi PBAYARD,
    I see that you are experiencing an issue with your iPod classic. Here is an article for you that will hep you through some troubleshooting steps regarding this issue:
    iPod: No power or frozen - Apple Support
    https://support.apple.com/en-us/TS1404
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • Show splash screen for x amount of seconds

    Is there a better way to show a splash screen for x seconds than putting it in a while loop? It just seems so inefficiant and it uses a lot of processing power. This is what I have: long startTime = System.currentTimeMillis();
    while(System.getCurrentTimeMillis() <= startTime + 5000) {
        //wait
    mainPage.setVisible(true);

    javax.swing.Timer.
    Also:
    http://java.sun.com/javase/6/docs/api/java/awt/SplashS
    creen.htmlThank you, I knew there had to be a better way.

  • Excel 2013 stalling at splash screen for files in use by others

    Excel 2013 is stalling (and not opening) when trying to open a file that is in use by another user. In office 2010 it would prompt the user to open in read-only mode, but in 2013 it seems to just stall and never open. It just stays on the splash screen
    for ever. We have done some testing and it appears that double clicking on an excel file causes this to occur, but will function correctly if the file is opened through excel's file browser.  Any suggestions on how to fix this?  It's a pain to make
    all the users open excel first, then browse through a lengthy network location.  Thanks in advance!
    For information purposes: these are files on a network location shared by many users.

    Hi,
    Did the issue occur when you just installed the Office 2013 or after using Office 2013 sometimes? I recommend we try the following methods and test to check if they are helpful.
    1. Click the File tab>Options>Advanced>scroll down to the General section>Clear the Ignore other applications that use Dynamic Data Exchange (DDE) check box in the General area.
    2. Install the latest Cumulative Update for Excel
    3. Right click on the Start Button>Click 'Open Windows Explorer'> click Organize > Layout> Uncheck Details Pane and Preview Pane.
    On a Windows menu, click on Tools > Folder Options.  In the box that opens up, click on the View tab.  Scroll down the list to “Show pop-up description for folder and desktop items” and clear the checkbox and then click OK.
    4. Check/Disable the Excel add-ins
    5. Repair Office.
    Hope it's helpful.
    Regards,
    George Zhao
    TechNet Community Support

  • HT1338 While booting macbook pro OSX lion 10.7.3 display blue screen for 3 seconds and booting,booting time is also very high. HOw to solve the proble

    while booting macbook pro OSx version MAC OSX 10.7.3 display blue screen for some 5 second and continue the booting? such that booting time is high.How to resolve the problem.please guide me to solve that.I have tried NEW installation format installed 10.7.3 from online installation after that aslo im getting the ame problem.

    Run through this list and get back with me
    Step by Step to fix your Mac
    Mac won't boot or "You need to restart"
    Create a data recovery, undelete boot drive

  • OpenSUSE-inspired splash screen for GIMP

    I saw this (old) openSUSE splash screen for GIMP and quite liked it:
    And so I created a new version of it, using Inkscape.  The PNG splash screen should be placed in $HOME/.gimp-2.6/splashes/ (or .gimp-2.7/ if you're using gimp-devel).  The font used is FifthLeg, which is based upon the font used in the openSUSE splash, and can be found in the AUR under otf-fifthleg: http://aur.archlinux.org/packages.php?ID=23740.
    The quick install (original version):
    mkdir -p $HOME/.gimp-2.8/splashes
    wget http://oi43.tinypic.com/s33fo9.jpg -O $HOME/.gimp-2.8/splashes/gimp-splash.png
    Here is the SVG file, in case you want to scale it up/down or change anything for your usage:
    http://www.mdn.fm/files/100696_f4f0h/gimp-splash.svg
    Screenshot:
    EDIT: Switched image hosting from ImageShack to TinyPic ... ImageShack has been very unreliable in the past few years.
    EDIT: Updated links (TinyPic is forcing the extension to JPG for whatever reason, but the file itself is a PNG). SVG link is dead.
    Last edited by MkFly (2015-05-27 15:33:01)

    Anonymo wrote:But you used Inkscape to make it? 
    Yes, I appreciate the irony there.  I wanted it to be easily scalable, and I didn't want to make some gigantic XCF.
    That and, I wanted to learn a little more about Inkscape.  The combination of the two (GIMP, Inkscape) is outstanding.
    Last edited by MkFly (2010-05-17 15:58:34)

  • TO STOP WORKFLOW TEMPORORILY for a period of time

    how can i stop running workflow tempororily for a period of time
    for ex: 7 days.
    any one pls answer this,its urgent
    if not pls send any links regarding this topic...

    hi  krishna,
    thanks for u  r reply,
    i created custom function module z*********.
    in swe2 for check FM text box i  assigned that fn module
    In workflow builder start conditions
    when click on that start conditions pop screen is appeared
    to choose any one.
    for the current scenario
    --which option i have to choose when i click on start conditions button .
    --i have created date attribute in object type,In function module how can i access object attribute to write a condition in function module.
    --can u send me the logic please.

  • TS3899 How to fix Sent emails getting stuck in Outbox for a period of time before being sent?

    How do you fix Sent emails getting s tuck in Outbox for a period of time before they actually send?
    The error message says that my "sender address is rejected by the server", but it eventually does send.

    Have you tried a Reset [Hold the Home and Sleep/Wake buttons down together for 10 seconds or so (until the Apple logo appears) and then release. When the screen goes blank then power ON again in the normal way.] It is 'appsolutely' safe!

  • How to block internet connection for a period of time?

    Hey guys is there a way to block internet connection via a lan connection for a period of time? A program that when my pc is boot up it run secretly and at the time schedule it block the internet connection with no pop up. When i not at home some person
    used my pc to use my internet connection everyday. I can't lock up my pc since my brother or my dad used it.
     

    Hi,
    You could create a schedule task to achieve this.
    The detailed solution please refer to this thread:
    https://social.technet.microsoft.com/Forums/en-US/7544cbed-507d-4eef-907d-bafb99b45411/disable-internet-for-a-set-period-of-time?forum=w7itprogeneral
    Karen Hu
    TechNet Community Support

  • 4 albums purchased from iTunes yesterday have songs not playing all the way through. They play for a period of time and skip to the next song. Everytime they are played. Can anyone help?

    Some songs I purchased last night are not playing all the way through. Several songs from the 4 albums I purchased play for a period of time then just skip to the next song. The songs that do this, do it everytime they are played at the exact same spot. The songs that are affected skip to the next on iTunes on my PC which is updated to the most current iTunes and my 160gb iPod classic. Everytime they are played at the exact same spot. However on my other device, iPhone 4s all songs play just fine. I have almost 7,000 songs on my iPod and this has never happened before and I have played it awhile since downloading those albums yesterday. This is only happening with the albums purchased yesterday. Can anyone help me figure out what is wrong?

    I'm having the same issue with a few songs I just downloaded. It skips randomly in the middle of the song.

Maybe you are looking for