Package gr.zeus.ui

Class JSplash

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer

public final class JSplash extends JWindow
A simple, yet nice splash screen implementation for java applications. Follows Sun recommendations for splash screen and logos: see "Designing Graphics for Corporate and Product Identity". Draws a black border of one pixel wide around the splash image. Also uses a simple progress bar that the user must "progress" manually in his code in order for it to work. Also, it has options for percent display, custom loading messages display and application version string display at the bottom-right corner of the image.

Since:
1.0
Author:
Gregory Kotsaftis
See Also:
  • Constructor Details

    • JSplash

      public JSplash(URL url, boolean progress, boolean messages, boolean percent, String versionString, Font versionStringFont, Color versionStringColor)
      Constructor for the splash window.

      Parameters:
      url - Image for ImageIcon.
      progress - Do we want a progress bar at all?
      messages - If we want a progress bar, do we want to display messages inside the progress bar?
      percent - If we want a progress bar, do we want to display the percent?
      versionString - If null no string is displayed on the bottom-right of the splash window.
      versionStringFont - Font for version string, if null default.
      versionStringColor - Color for version string, if null default.

      NOTE: Use only one flag for: messages / percent (one or the other, NOT both).

  • Method Details

    • splashOn

      public void splashOn()
      Displays the splash screen
    • splashOff

      public void splashOff()
      Hides and disposes the splash screen
    • setProgress

      public void setProgress(int value)
      Sets the progress indicator (values: 0 - 100).

      Parameters:
      value - The progress indicator value.
    • setProgress

      public void setProgress(int value, String msg)
      Sets the progress indicator (values: 0 - 100) and a label to print inside the progress bar.

      Parameters:
      value - The progress indicator value.
      msg - The message to print.
    • getProgressBar

      public final JProgressBar getProgressBar()
      Get the progress bar for custom usage.

      Returns:
      The progress bar.