🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #13018

Re: how can I make a splash screen?

#13018
From: william.a.rawlings
Date: Wed, 07 Oct 1998 00:00
77 lines
2676 bytes
here is some code that does it...

package whatever;

import java.awt.*;
import borland.jbcl.control.*;
import java.awt.event.*;

public class splashScreen extends Frame
{

  Toolkit toolkit = Toolkit.getDefaultToolkit();
  Window window;
  ImageControl image = new ImageControl();

  public splashScreen()
  {
    window = new Window(this);

    try
    {
      jbInit();
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }

  private void jbInit() throws Exception
  {
    image.setImageName("C:\\TEMP\\work\\splash.gif");
    window.add(image);
    window.setSize(308,300);     // this is the exact size of the .gif
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = window.getSize();
    if (frameSize.height > screenSize.height)
      frameSize.height = screenSize.height;
    if (frameSize.width > screenSize.width)
      frameSize.width = screenSize.width;
    window.setLocation((screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
    window.show();
    window.toFront();

  }
}

i have an animated .gif in there...looks great!....have fun

bill rawlings
lockheed martin tds - arizona


In article <MPG.107db98a6f768b9989917@forums.borland.com>,
  tfrysinger@uswest.net (Tad Frysinger) wrote:
> In article <3613DA13.904FE7B5@sema4.com>, ahumphreys@sema4.com says...
> > I'm trying to create a splash screen for my program.  Currently, I have
> > it set up as a Dialog, but I'd like to make the titlebar invisible.  How
> > can I do that?
> >
> > If I can't do that, are there other ways to make a splash screen?
> >
> > Thanks.
> >
> > Alex
> >
> >
> Check out the CliffHanger demo that ships with JBuilder - it does what
> you want.
>
> Tad Frysinger
> [TeamB]
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    
Technical Details
Message-ID: <6vfu0c$5ng$1@nnrp1.dejanews.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3613DA13.904FE7B5@sema4.com> <MPG.107db98a6f768b9989917@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,d59278f18297e0
X-Google-Attributes: gid111d45,public
From: william.a.rawlings@lmco.com
Subject: Re: how can I make a splash screen?
Date: 1998/10/07
Message-ID: <6vfu0c$5ng$1@nnrp1.dejanews.com>
X-Deja-AN: 398630054
References: <3613DA13.904FE7B5@sema4.com> <MPG.107db98a6f768b9989917@forums.borland.com>
X-Http-Proxy: 1.0 x2.dejanews.com:80 (Squid/1.1.22) for client 192.91.146.35
Organization: Deja News - The Leader in Internet Discussion
X-Article-Creation-Date: Wed Oct 07 14:31:40 1998 GMT
Newsgroups: borland.public.jbuilder.java.swing
X-Http-User-Agent: Mozilla/4.03 [en] (Win95; U ;Nav)