Package java.awt

Examples of java.awt.SplashScreen


   */
  private static final Class<?>[] PARAMETERS = new Class[] { URL.class };


  public static void main(String[] args) {
    final SplashScreen splash = SplashScreen.getSplashScreen();

    File libFolder = new File("ext");
    List<File> jars = findJars(libFolder.getAbsoluteFile());

    // sort the jars by name and then reverse the order so the newer version
View Full Code Here


   * Parameters of the method to add an URL to the System classes.
   */
  private static final Class<?>[] PARAMETERS = new Class[] { URL.class };

  public static void main(String[] args) {
    final SplashScreen splash = SplashScreen.getSplashScreen();

    File libFolder = new File("ext");
    List<File> jars = findJars(libFolder.getAbsoluteFile());

    // sort the jars by name and then reverse the order so the newer version
View Full Code Here

        }

    }

    public void updateSplash(String s){
        SplashScreen splash = SplashScreen.getSplashScreen();
        if (splash != null){

            Graphics g = splash.createGraphics();
            g.setColor(Color.WHITE);
            g.fillRect(110, 105, 500, 500);
            g.setColor(Color.BLACK);
            g.drawString(s, 120, 120);
            g.dispose();

            try{
                splash.update();
            }catch(IllegalStateException e){
                // ignore
            }

        }
View Full Code Here

            }
        }).start();
    }

    private void updateProgress(SplashScreenStages stage) {
        SplashScreen ss = SplashScreen.getSplashScreen();
        if (ss != null) {
            Graphics2D ssg = ss.createGraphics();
            ssg.setComposite(AlphaComposite.Clear);
            ssg.fillRect(450, GameCanvas.PREFERRED_SIZE.height - 70,
                    GameCanvas.PREFERRED_SIZE.width,
                    GameCanvas.PREFERRED_SIZE.height);
            ssg.setPaintMode();

            Font f = new Font("Courier", Font.BOLD, 14);
            ssg.setFont(f);
            FontMetrics fm = ssg.getFontMetrics(f);

            ssg.drawString(stage.getMessage(), 450,
                    GameCanvas.PREFERRED_SIZE.height - 40
                            - (fm.getMaxAscent() + fm.getMaxDescent()));
            ss.update();
        }
    }
View Full Code Here

     */
    @Override
    public void lifecycleEvent(LifecycleEvent event) {
        if(event.getType().equals(Lifecycle.AFTER_START_EVENT)) {
            if(!GraphicsEnvironment.isHeadless()) {
                SplashScreen splashScreen = SplashScreen.getSplashScreen();
                if(splashScreen != null) {
                    try {
                        splashScreen.close();
                    } catch (IllegalStateException e) {
                       
                    }
                }
            }
View Full Code Here

     */
    @Override
    public void lifecycleEvent(LifecycleEvent event) {
        if(event.getType().equals(Lifecycle.AFTER_START_EVENT)) {
            if(!GraphicsEnvironment.isHeadless()) {
                SplashScreen splashScreen = SplashScreen.getSplashScreen();
                if(splashScreen != null) {
                    try {
                        splashScreen.close();
                    } catch (IllegalStateException e) {
                       
                    }
                }
            }
View Full Code Here

  @NonBlocking
  public void boot() {
    SwingUtilities.invokeLater( new Runnable() {
      @Override
      public void run() {
        final SplashScreen splash = SplashScreen.getSplashScreen();
        if ( splash == null ) {
          return;
        }

        application.updateSplash( splash );
View Full Code Here

         System.exit(2);
      }
   }

   private static void closeSplashScreen(long untilMs) throws InterruptedException {
      SplashScreen screen = SplashScreen.getSplashScreen();
      if (screen != null) {
         long splashWaitMs = untilMs - System.currentTimeMillis();
         if (splashWaitMs > 0) {
            Thread.sleep(splashWaitMs);
         }
         screen.close();
      }
   }
View Full Code Here

TOP

Related Classes of java.awt.SplashScreen

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.