Results 1 to 3 of 3
  1. #1
    Charlie161 is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default Splashscreen returns null

    Hi

    I'm trying to make a SplashScreen, I read there is a SplashScreen() class.

    I made this:
    Java Code:
    package GUI;
    
    
    import java.awt.*;
    import java.io.IOException;
    
    /**
     * Created by IntelliJ IDEA.
     * Date: 3/03/11
     * Time: 13:54
     */
    
    public class Splash {
        final SplashScreen scherm = SplashScreen.getSplashScreen();
    
        public Splash() {
               if(scherm == null){
                   System.out.println("returns null");
               }
    
    
            try {
                scherm.setImageURL(this.getClass().getResource("splashscreen.png"));
            } catch (IOException e) {
                e.printStackTrace();
            }
    
            scherm.update();
            scherm.isVisible();
        }
    
        public static void main(String[] args) {
            new Splash();
            new MenuUI("Game");
        }
    
    }
    Why is this returning null?

    Thanks in advance

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,963
    Rep Power
    8

    Default

    When/how are you setting the SplashScreen? It doesn't just work automatically. Consult the API.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Charlie161 is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

Similar Threads

  1. getImplementationVersion() returns null
    By newbiejava in forum New To Java
    Replies: 22
    Last Post: 09-12-2010, 09:31 AM
  2. Replies: 1
    Last Post: 08-20-2010, 11:30 AM
  3. helpset findHelpSet returns null
    By kmm1977 in forum AWT / Swing
    Replies: 23
    Last Post: 06-22-2010, 03:53 PM
  4. SplashScreen.getSplashScreen() returned null
    By kmm1977 in forum AWT / Swing
    Replies: 4
    Last Post: 06-21-2010, 11:04 AM
  5. SplashScreen.getSplashScreen() returned null
    By ibrahimyoussof in forum AWT / Swing
    Replies: 2
    Last Post: 04-17-2010, 02:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •