Java Doc for SplashScreen.java in  » 6.0-JDK-Core » AWT » java » awt » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.SplashScreen

SplashScreen
final public class SplashScreen (Code)
The splash screen can be created at application startup, before the Java Virtual Machine (JVM) starts. The splash screen is displayed as an undecorated window containing an image. You can use GIF, JPEG, and PNG files for the image. Animation (for GIF) and transparency (for GIF, PNG) are supported. The window is positioned at the center of the screen (the position on multi-monitor systems is not specified - it is platform and implementation dependent). The window is closed automatically as soon as the first window is displayed by Swing/AWT (may be also closed manually using the Java API, see below).

There are two ways to show the native splash screen:

  • If your application is run from the command line or from a shortcut, use the "-splash:" Java application launcher option to show a splash screen.
    For example:
     java -splash:filename.gif Test
     
  • If your application is packaged in a jar file, you can use the "SplashScreen-Image" option in a manifest file to show a splash screen. Place the image in the jar archive and specify the path in the option. The path should not have a leading slash.
    For example, in the manifest.mf file:
     Manifest-Version: 1.0
     Main-Class: Test
     SplashScreen-Image: filename.gif
     
    The command line interface has higher precedence over the manifest setting.

The SplashScreen class provides the API for controlling the splash screen. This class may be used to close the splash screen, change the splash screen image, get the image position/size and paint in the splash screen. It cannot be used to create the splash screen; you should use the command line or manifest file option for that.

This class cannot be instantiated. Only a single instance of this class can exist, and it may be obtained using the SplashScreen.getSplashScreen() static method. In case the splash screen has not been created at application startup via the command line or manifest file option, the getSplashScreen method returns null.
author:
   Oleg Semenov
since:
   1.6




Constructor Summary
 SplashScreen(long ptr)
    

Method Summary
public  voidclose()
     Hides the splash screen, closes the window, and releases all associated resources.
public  Graphics2DcreateGraphics()
     Creates a graphics context (as a Graphics2D object) for the splash screen overlay image, which allows you to draw over the splash screen. Note that you do not draw on the main image but on the image that is displayed over the main image using alpha blending.
public  RectanglegetBounds()
     Returns the bounds of the splash screen window as a Rectangle .
public  URLgetImageURL()
     Returns the current splash screen image.
public  DimensiongetSize()
     Returns the size of the splash screen window as a Dimension .
public static  SplashScreengetSplashScreen()
     Returns the SplashScreen object used for Java startup splash screen control.
public  booleanisVisible()
     Determines whether the splash screen is visible.
public  voidsetImageURL(URL imageURL)
     Changes the splash screen image.
public  voidupdate()
     Updates the splash window with current contents of the overlay image.


Constructor Detail
SplashScreen
SplashScreen(long ptr)(Code)




Method Detail
close
public void close() throws IllegalStateException(Code)
Hides the splash screen, closes the window, and releases all associated resources.
throws:
  IllegalStateException - if the splash screen has already been closed



createGraphics
public Graphics2D createGraphics() throws IllegalStateException(Code)
Creates a graphics context (as a Graphics2D object) for the splash screen overlay image, which allows you to draw over the splash screen. Note that you do not draw on the main image but on the image that is displayed over the main image using alpha blending. Also note that drawing on the overlay image does not necessarily update the contents of splash screen window. You should call update() on the SplashScreen when you want the splash screen to be updated immediately. graphics context for the splash screen overlay surface
throws:
  IllegalStateException - if the splash screen has already been closed



getBounds
public Rectangle getBounds() throws IllegalStateException(Code)
Returns the bounds of the splash screen window as a Rectangle . This may be useful if, for example, you want to replace the splash screen with your window at the same location.

You cannot control the size or position of the splash screen. The splash screen size is adjusted automatically when the image changes. a Rectangle containing the splash screen bounds
throws:
  IllegalStateException - if the splash screen has already been closed




getImageURL
public URL getImageURL() throws IllegalStateException(Code)
Returns the current splash screen image. URL for the current splash screen image file
throws:
  IllegalStateException - if the splash screen has already been closed



getSize
public Dimension getSize() throws IllegalStateException(Code)
Returns the size of the splash screen window as a Dimension . This may be useful if, for example, you want to draw on the splash screen overlay surface.

You cannot control the size or position of the splash screen. The splash screen size is adjusted automatically when the image changes. a Dimension object indicating the splash screen size
throws:
  IllegalStateException - if the splash screen has already been closed




getSplashScreen
public static SplashScreen getSplashScreen()(Code)
Returns the SplashScreen object used for Java startup splash screen control.
throws:
  UnsupportedOperationException - if the splash screen feature is notsupported by the current toolkit
throws:
  HeadlessException - if GraphicsEnvironment.isHeadless() returns true the SplashScreen instance, or null if there isnone or it has already been closed



isVisible
public boolean isVisible()(Code)
Determines whether the splash screen is visible. The splash screen may be hidden using SplashScreen.close() , it is also hidden automatically when the first AWT/Swing window is made visible. true if the splash screen is visible (has not been closed yet),false otherwise



setImageURL
public void setImageURL(URL imageURL) throws NullPointerException, IOException, IllegalStateException(Code)
Changes the splash screen image. The new image is loaded from the specified URL; GIF, JPEG and PNG image formats are supported. The method returns after the image has finished loading and the window has been updated. The splash screen window is resized according to the size of the image and is centered on the screen.
Parameters:
  imageURL - the non-null URL for the newsplash screen image
throws:
  NullPointerException - if imageURL is null
throws:
  IOException - if there was an error while loading the image
throws:
  IllegalStateException - if the splash screen has already beenclosed



update
public void update() throws IllegalStateException(Code)
Updates the splash window with current contents of the overlay image.
throws:
  IllegalStateException - if the overlay image does not exist; for example, if createGraphics has never been called,or if the splash screen has already been closed



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.