How to make Splash Screen

Hello,
Attempting to create a splash screen. However, i'm having some difficulty. the screen seems to hang albeit there's some functionality in the code that requests the screen disposes itself. Also, the image for the screen is flickering albeit the Update() method has been overriden to call the overriden paint method. the splash screen is comprised of two classes: SplashWindow and Splash. the Splash class is invoked from the Main method of the application.
Unfortunately, the SplashScreen object can't be used since the target device requires jre 1.4.2 and below.
Here's the code from the two classes:
import java.awt.Frame;
import java.awt.Toolkit;
import java.net.URL;
public class Splash {
     public static void main(String[] args) {
          Frame splashFrame = null;
          URL imageURL = Splash.class.getResource("img.png");
          if (imageURL != null) {
               splashFrame = SplashWindow.splash(
                         Toolkit.getDefaultToolkit().createImage(imageURL) );
          } else {
               System.err.println("Splash image not found");
          try { // Change the class name to match your entry class
               Class.forName("MainApp").getMethod("main", new Class[]
                         {String[].class}).invoke(null, new Object[] {args});
          } catch (Throwable e) {
               e.printStackTrace();
               System.err.flush();
               System.exit(10);
          if (splashFrame != null) {
               splashFrame.dispose();
/*END OF CLASS*/
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.Toolkit;
import java.awt.Window;
public class SplashWindow extends Window {
     private static final long serialVersionUID = 1L;
     private Image splashImage;
     private boolean paintCalled = false;
     public SplashWindow(Frame owner, Image splashImage) {
          super(owner);
          this.splashImage = splashImage;
          MediaTracker mt = new MediaTracker(this);
          mt.addImage(splashImage,0);
          try {
               mt.waitForID(0);
          } catch(InterruptedException ie) {}
          int imgWidth = splashImage.getWidth(this);
          int imgHeight = splashImage.getHeight(this); 
          setSize(imgWidth, imgHeight);
          Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
          setLocation( (screenDim.width - imgWidth) / 2,
                    (screenDim.height - imgHeight) / 2 );
     @Override
     public void update(Graphics g) {
          g.setColor(getForeground());
          paint(g);
     @Override
     public void paint(Graphics g) {
          g.drawImage(splashImage, 0, 0, this);
          if (! paintCalled) {
               paintCalled = true;
               synchronized (this) { notifyAll(); }
     @SuppressWarnings("deprecation")
     public static Frame splash(Image splashImage) {
          Frame f = new Frame();
          SplashWindow w = new SplashWindow(f, splashImage);
          w.toFront();
          w.show();
          if (! EventQueue.isDispatchThread()) {
               synchronized (w) {
                    while (! w.paintCalled) {
                         try {
                              w.wait();
                         } catch (InterruptedException e) {}
          }  end of class
// in the Main method of the application, the Splash object is instantiated and it's main method invoked
Splash oSplash = new Splash();
oSplash.main(args);any help is appreciated.

i was able to find the solution to the problem. it appears that there are couple calls in the code to synchronize the thread the splash screen is running on. these multiple calls was causing the flicker. so, i removed the "synchronized" call in the paint method.
the infinite loop was being caused by "forName" call for the class, so it was removed as well.

Similar Messages

  • Is there other way to make Splash-Screen more Richer ?

    Is there other way to make Splash-Screen more Richer ?
    I want to design the the Splash-Screen like use a page(can use XAML layout)? I'll do more things? how can i do it?
    Not use like as following:
    <VisualElements DisplayName="consumewebapi" Logo="Assets\Logo.png" SmallLogo="Assets\SmallLogo.png" Description="consumewebapi" ForegroundText="light" BackgroundColor="#464646">
    <DefaultTile ShowName="allLogos" />
    <SplashScreen Image="Assets\SplashScreen.png" />
    </VisualElements>

    The splash screen shows before your app's code runs so there isn't any opportunity for the app code to modify or enhance it.
    Once the app has loaded and started running it can show an extended splash screen which it can modify and enhance however you'd like. See How to extend the
    splash screen (XAML)

  • Can someone tell me how to make my screen full size with Safari ?  I am using a Mac osx 10.6.8.

    Can someone tell me how to make my screen full size on my Mac OSX 10.6.8. using safari.  I know this is a simple question. I have always had it on full screen and recently had it worked on remotely and now I can't get the screen back to full size.  I appreciate any advise you can offer. Thank you

    from the BetterTouchTool blog, older versions can be obtained using these links:
    The last 64bit Snow Leopard (10.6 ) version (v 0.939 ) can be downloaded here
    <http://bettertouchtool.net/btt0.939.zip>
    If you are using an older 32bit Mac you’ll have to use this version: 0.785
    <http://bettertouchtool.net/btt0.785.zip>

  • How to make full screen on safari

    how to make full screen on safari

    One way is to download and install Saft - MacUpdate or CNET Downloads.
    Or you can click on the green expland gadget in the top right of Safari's titlebar.  However, this will not expand Safari to a true full-screen view as will Saft.

  • How to make color screen in Web dynpro appl?

    How to make color screen in Web dynpro appl?

    Hi Gobi..
    <u><b>Go thorugh the follwing links</b></u>
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/forum.jspa%3FforumID%3D52
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/business_packages/a1-8-4/nw04stack09themes.zip
    <u><b>Tutorial</b></u>
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how%20to%20edit%20web%20dynpro%20themes.pdf
    <u><b>Setting the Theme</b></u>
    http://help.sap.com/saphelp_nw2004s/helpdata/en/1e/535d420447e054e10000000a155106/content.htm
    <u><b>Configuration</b></u>
    http://help.sap.com/saphelp_nw70/helpdata/en/43/8a1a8ece230c8ce10000000a11466f/content.htm
    Regards,
    GS
    Message was edited by:
            Sathishkumar GS
    Message was edited by:
            Sathishkumar GS

  • How to make the screen dim while music is playing

    I can't get the screen to dim while playing music on my iPod Nano.  It used to be that the screen dimmed while music was playing until it lit up when I hit a button to change volume, track, etc.  This preserved the battery life.  It seems that I inadvertantly changed some setting just a few days ago because I saw the apple logo appear on the screen and since then have not been able to figure out how to make the screen dim while playing music.  I think the fact that the screen is staying on while I'm listening now is making the battery out very quickly.  Does anyone know how to solve this problem?  Thank you!

    Hello ZingMA,
    You need to reset the backlight timer.
    Go to settings, general, and backlight. You should be able to set if from there. I am assuming you have a 6th gen nano. If you have a different model the user manuals have the steps. Found here:
    iPod nanos
    Hope this helps.
    ~Julian

  • My iphone 5's lock button is broken, and i believe its on "curtain mode" siri works ect... but i dont know how to make the screen turn on again

    My iphone 5 randomly froze so i used my accesibility button to lock the scre because my lock screen button is broken. After i locked it it wouldn't turn back on. The screen is off but i can still hear notifications and Siri. I dont know how to make it work. help?

    See: https://ssl.apple.com/support/iphone5-sleepwakebutton/

  • How to make my screen fullscreen

    some how my screen isnt fullscreen and i dont know how to make put it back to how it was before. All my windows and everything are smaller

    Ful lscreen window
    http://support.apple.com/kb/PH11359

  • How to view splash screen longer ?

    Hi,
    I'm designing custom splash screen. Is there any way to see it longer time than page loading ? It's some to fast :)
    Kuba

    Hi!
    I don't know (at this moment) the ADF-only way to do this, but you can improvise with plain javascript:
    <script>
    function showImage() {
      document.all.splashImage.style.visibility = "hidden";
    function hideImage() {
      document.all.splashImage.style.visibility = "hidden";
    function onLoad() {
      showImage();
      SetTimeout("hideImage();", 1000*5); // SetTimeout takes a number of milliseconds e.g. here 5 seconds
    </script>Now, you have to figure out how you want this to be applied to your use-case. If you want this splash to appear after the default (showing the ADF RC initialization) then just attach the onLoad() to the af:document clientListener type=load. If you want to replace the default with your own, you have to more work... you have to figura out how.
    Regards,
    PaKo

  • How to create executable to run in application and how to make full screen

    I am developing an application for running in Desktop.
    How should I make a executable so that I can launch application directly ?
    Additionally, how to make the stage/scene to full screen throught the code (without explicitly mentioning height and width), because the monitor/display size might vary from model to model.

    I don't know if you can make a standalone executable, although there are packagers for Java doing that. I don't know if they are usable with JavaFX. License prohibits to package the runtime, so it must be downloaded on each computer from Sun servers. That's what the JNLP does, I think.
    You can also create a shortcut on the desktop with a setting in the JNLP: inside the <information> tag, you can put:
            <shortcut>
                <desktop/>
            </shortcut>to create a shortcut (user is prompted and can decline).

  • FM OUTLINE_LIST_TCODES , how to make the screen looks bigger

    hi guys,
    i have used OUTLINE_LIST_TCODES to display 11 selection tabs,it ends up having to scroll down , how to expand the screen and make it bigger without hving to scroll

    s

  • How to deactivate splash-screen offering "edit" / "organize"?

    I have just updated (on Mac OS X) to version 9. I don't want to use the Adobe Organizer, which seems to be new in this version. I never want to see it or use it, I just want to edit photographs.
    How can I jump over the splash screen straight into Photoshop Elements when I start the program?
    Thanks!
    John

    You made an alias to the wrong file. Go into applications and you'll see this:
    You want to drag the one without the version number or the little arrow on the lower left corner into the dock. That's the actual program. The one below it is an alias for the Welcome Screen.

  • How to make a screen capture

    Hello,
    I want to make a screen movie of my iPad to tell other people how to use a iPad app.
    Does anybody know wether there is an app for this problem?
    Best regards.
    Erwin.

    If you have a PC or a Mac, there is a simple program called Reflection that uses AirPlay to send the iPad display to your computer's screen. You can then use a screen capture application to capture the output.
    There are other AirPlay apps available, but Reflection is the one I use.
    I wrote a blog article which reviews the app and provides a link to a YouTube video that shows how to set it up and get it going.
    http://goo.gl/ZLH9R
    It's quite a bit cheaper than HDMI output, and gives fairly good results (although you will need a fast wireless network to get the best results and avoid screen jitters)
    I hope this helps

  • Satellite L300: How to make the screen less blue?

    Hi,
    Is it possible to make the screen less blue, not fully color managed, just a little warmer. TIA.

    Hey Zeb,
    Why you want to change the color management? Are not satisfied with the colors on your L300 screen? I have this notebook too and Im very satisfied with the color management. For me its all ok and I dont change anything on it.
    Anyway, you can change the colors in graphics driver menu. On Intel cards for example:
    Display properties > Settings > Advanced > Intel Graphics > Graphic Properties > Color Correction
    Greets

  • How to disable Splash Screen?

    Hi Experts,
    Whenever I am logging into CRM's WEB UI it throws a splash screen saying CRM is starting or Processing. Is there any way out by which I can disable this splash screen? This screen lasts only for few seconds.
    Thanks in advance!!
    Cheers,
    RJ

    Hi RJ,
    You can enhance the BSP Application CRM_UI_START. The part you need to change is on the page default.htm.
    The code that shows the box is:
    <%-- starting session --%>
    <div id="crmUIHostDialog" class="crmUIHostDialog">
      <thtmlb:box name="uif" >
        <span id="crmUIHostDialogText"><%=otr(CRM_BSP_UI_FRAME_APPL/SessionStart)%></span>
        <br/><img src="ScreenLoadingAniSmall.gif"/>
      </thtmlb:box>
    </div>
    Regards,
    Isaac Meléndez

Maybe you are looking for

  • Do I Really Need To Uninstall IMovie '11 to Access Completed Projects from IMovie '09?

    Hi everyone: What's Happening I would like to uninstall IMovie '11 so I can complete a project I spent hours (and hours) creating in IMovie '09. I am frustrated that IMovie '11 has deleted the project I had previously in IMovie '09, after I upgraded

  • IMP-00017: following statement failed with ORACLE error 1652

    when i importing the dump file, i got such error.IMP-00003: ORACLE error 1652 encountered ORA-01652: unable to extend temp segment by 128 in tablespace TEMP. but the imp program is still going after got such error message. Do I have to stop the impor

  • SQL Server plug in and windows server 2008

    Windows Server 2008 SQL Server 2008 JDBC drivers 3.0 I am trying to setup Oracle Grid to monitor the SQL Server instances and ive resolved most of the issues execpt i keep getting the following error when testing connection to SQL server Warning Fail

  • Ipod photo: problem with artwork

    It seems that on Itunes, my artowrk is all correct, but on my ipod, the imgaes are jumbled up for some of the albums. Does anyone know how to solve this problem? Thanks.

  • Export PSD with Smart Object??

    In Lightroom, when exporting files in the PSD format, is there a way to keep the background layer as a Smart Object connected to the original RAW file? When I edit photos in Camera Raw 4.3.1, I always check "Open in Photoshop as Smart Object", but I