Home about services products contact login
   com.smardec.asc

Advanced Swing Components

  animatepanel
  autocomplete
  dropdown
  filechooser
  fontchooser
  gradient
  hyperlink
  outlookpanel
  outlookpanel.renderers
  quick
  rotate
  sliderpanel
  spantable
  splashscreen
  statusbar
  table
  table.renderers
  table.wrappers
  tree
  treetable
  util
  xmlbars
  xmlbars.menubar
  xmlbars.toolbar
  xmlbars.toolbar.layouts
com.smardec.asc.splashscreen
Class JSplashScreen

java.lang.Object
|
+--com.smardec.asc.splashscreen.JSplashScreen

public class JSplashScreen
extends java.lang.Object

JSplashScreen is highly configurable splash screen component. It can display image or user defined panel. JSplashScreen allows to set whether it should be closed on mouse click, minimum display time, display time and border.
Image can be set as javax.swing.ImageIcon, java.awt.Image, path to the image or java.net.URL location of the image file. JSplashScreen autoresizes to fit image dimensions.
To show user defined custom panel it should be set by setCustomPanel(javax.swing.JPanel).

Sample usage:

    JSplashScreen splash = new JSplashScreen(parentFrame);
    splash.setImage("path/to/image");
    splash.setBorder(BorderFactory.createLineBorder(Color.black, 1));
    splash.setCloseOnClick(true);
    splash.setMinimumDisplayTime(1000);
    splash.setDisplayTime(3000);
    splash.showSplash();


Field Summary
static int INFINITE
If minimumDisplayTime or displayTime is set to INFINITE than it is not used.
Constructor Summary
JSplashScreen()
Creates initially invisible, non-modal splash screen.
JSplashScreen(java.awt.Window owner)
Creates initially invisible, modal splash screen.
Method Summary
javax.swing.border.Border getBorder()
Returns the border shown around the image or custom panel.
javax.swing.JPanel getCustomPanel()
Returns user defined panel shown in splash screen instead of image.
int getDisplayTime()
Returns display time in milliseconds.
java.awt.Rectangle getHyperlinkRectangle()
Returns Rectangle with hyperlink area.
int getMinimumDisplayTime()
Returns minimum display time in milliseconds.
java.lang.String getUrl()
Returns url string.
void hideSplash()
Hides splash screen.
void hideSplash(boolean force)
Hides splash screen.
boolean isCloseOnClick()
Indicates whether splash screen should be closed on a mouse click.
void setBorder(javax.swing.border.Border border)
Sets the border shown around the image or custom panel.
void setCloseOnClick(boolean closeOnClick)
Specifies whether splash screen should be closed on a mouse click.
void setCustomPanel(javax.swing.JPanel customPanel)
Sets user defined panel shown in splash screen instead of image.
void setDisplayTime(int displayTime)
Sets display time in milliseconds.
void setHyperlinkRectangle(java.awt.Rectangle hyperlinkRectangle)
Sets Rectangle with hyperlink area.
void setImage(java.awt.Image image)
Sets image shown in splash screen.
void setImage(javax.swing.ImageIcon image)
Sets image shown in splash screen.
void setImage(java.lang.String filename)
Sets image shown in splash screen.
void setImage(java.net.URL location)
Sets image shown in splash screen.
void setMinimumDisplayTime(int minimumDisplayTime)
Sets minimum display time in milliseconds.
void setUrl(java.lang.String url)
Sets url string.
void showSplash()
Shows splash screen.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail
INFINITE
public static final int INFINITE

If minimumDisplayTime or displayTime is set to INFINITE than it is not used.

See Also:
Constant Field Values
Constructor Detail
JSplashScreen
public JSplashScreen()
Creates initially invisible, non-modal splash screen. To create modal splash screen use JSplashScreen(Window).


JSplashScreen
public JSplashScreen(java.awt.Window owner)
Creates initially invisible, modal splash screen. To create non-modal splash screen use JSplashScreen().

Parameters:
owner - owner window, splash screen will be modal relative to the owner
Method Detail
setImage
public void setImage(javax.swing.ImageIcon image)
Sets image shown in splash screen.

Parameters:
image - image to show

setImage
public void setImage(java.awt.Image image)
Sets image shown in splash screen.

Parameters:
image - image to show

setImage
public void setImage(java.lang.String filename)
Sets image shown in splash screen.

Parameters:
filename - path to the image

setImage
public void setImage(java.net.URL location)
Sets image shown in splash screen.

Parameters:
location - location of the image

getCustomPanel
public javax.swing.JPanel getCustomPanel()
Returns user defined panel shown in splash screen instead of image.

Returns:
user defined panel. Default is null.

setCustomPanel
public void setCustomPanel(javax.swing.JPanel customPanel)
Sets user defined panel shown in splash screen instead of image.

Parameters:
customPanel - user defined panel

getBorder
public javax.swing.border.Border getBorder()
Returns the border shown around the image or custom panel.

Returns:
user defined border. Default is null.

setBorder
public void setBorder(javax.swing.border.Border border)
Sets the border shown around the image or custom panel.

Parameters:
border - user defined border

isCloseOnClick
public boolean isCloseOnClick()
Indicates whether splash screen should be closed on a mouse click.

Returns:
true if splash screen should be closed on a mouse click; false otherwise.

setCloseOnClick
public void setCloseOnClick(boolean closeOnClick)
Specifies whether splash screen should be closed on a mouse click.

Parameters:
closeOnClick - true if splash screen should be closed on a mouse click; false otherwise

getMinimumDisplayTime
public int getMinimumDisplayTime()
Returns minimum display time in milliseconds. If splash screen is displayed less than minimum display time it would not be closed on mouse click. To close splash screen prior to mimimum display time is elapsed use hideSplash(boolean) and pass true.

Returns:
minimum display time in milliseconds.

setMinimumDisplayTime
public void setMinimumDisplayTime(int minimumDisplayTime)
Sets minimum display time in milliseconds. If splash screen is displayed less than minimum display time it would not be closed on mouse click. To close splash screen prior to mimimum display time is elapsed use hideSplash(boolean) and pass true.

Parameters:
minimumDisplayTime - minimum display time in milliseconds

getDisplayTime
public int getDisplayTime()
Returns display time in milliseconds. After display time is elapsed splash screen closes.

Returns:
display time in milliseconds.

setDisplayTime
public void setDisplayTime(int displayTime)
Sets display time in milliseconds. After display time is elapsed splash screen closes.

Parameters:
displayTime - display time in milliseconds

showSplash
public void showSplash()
Shows splash screen.


hideSplash
public void hideSplash()
Hides splash screen. Same as hideSplash(boolean) with false parameter.


hideSplash
public void hideSplash(boolean force)
Hides splash screen.

Parameters:
force - true if splash screen should be closed even if minimum time is set and not elapsed; false if splash screen should be closed if minimum time is set and not elapsed. If minimum time is not set than splash screen will be closed

getHyperlinkRectangle
public java.awt.Rectangle getHyperlinkRectangle()
Returns Rectangle with hyperlink area.

Returns:
Rectangle with hyperlink area.

setHyperlinkRectangle
public void setHyperlinkRectangle(java.awt.Rectangle hyperlinkRectangle)
Sets Rectangle with hyperlink area.

Parameters:
hyperlinkRectangle - Rectangle with hyperlink area

getUrl
public java.lang.String getUrl()
Returns url string.

Returns:
url string.

setUrl
public void setUrl(java.lang.String url)
Sets url string.

Parameters:
url - url string
Home about services products contact login